Quantcast
Channel: database – Tech ABC to XYZ
Viewing all articles
Browse latest Browse all 31

Open messages in popup window – PHP [ANSWERED]

$
0
0

Open messages in popup window – PHP

Asked By: Vlada903
Originally Asked On: 2014-01-05 22:32:55
Asked Via: stackoverflow

I want something like when you click on image on facebook, url changes to facebook.com/photo.php?…. but without redirect. I want exactly the same thing but to open the messages, not photos. Simply, i want when user clicks on displayed messages with other users to open a new popup window without redirecting to new page with all messages with that user. Is that possible and if it is please tell me how to do that.

Example:
Messages with user A

Messages with user B
Messages with user C

And when user clicks on ‘Messages with user B’, it will open new popup window with all messages with that user, and of course, pulled from database.

He received 2 answers
eventually accepting:

Christian’s answer to

Open messages in popup window – PHP

I decided to write this as an answer since it is too long for a comment.

To “properly” set up what you want, you need several parts working together:

  • AJAX: (eg: jQuery.ajax) Retrieve data from the server programmatically with javascript
  • CSS/HTML dialog: (eg: jQueryUI dialog) Create a fake popup inside your page, usually to give the content some prominence
  • History State: (eg: SO Q/A) Change the page URL (in addressbar) without reloading the page.

The answer with the highest score with 1 points was:

Observer’s answer to

Open messages in popup window – PHP

I think I understand what you are looking for!

Use case scenario:

1- User looks at a feed of posts/images/anything.
2- User clicks on one of those posts and, it opens in a box with that same content.

The thing you are looking for is called “Lightbox” or “FancyBox”.

I googled and found a few examples:
http://fancyapps.com/fancybox/
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

http://lokeshdhakar.com/projects/lightbox/

you basically need to recreate the loop or make on a onclick function when user chooses the photo, and just call the index of that photo again inside the lightbox.

If the selected answer did not help you out, the other answers might!

All Answers For: Open messages in popup window – PHP

Observer’s answer to

Open messages in popup window – PHP

I think I understand what you are looking for!

Use case scenario:

1- User looks at a feed of posts/images/anything.
2- User clicks on one of those posts and, it opens in a box with that same content.

The thing you are looking for is called “Lightbox” or “FancyBox”.

I googled and found a few examples:
http://fancyapps.com/fancybox/
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

http://lokeshdhakar.com/projects/lightbox/

you basically need to recreate the loop or make on a onclick function when user chooses the photo, and just call the index of that photo again inside the lightbox.

Christian’s answer to

Open messages in popup window – PHP

I decided to write this as an answer since it is too long for a comment.

To “properly” set up what you want, you need several parts working together:

  • AJAX: (eg: jQuery.ajax) Retrieve data from the server programmatically with javascript
  • CSS/HTML dialog: (eg: jQueryUI dialog) Create a fake popup inside your page, usually to give the content some prominence
  • History State: (eg: SO Q/A) Change the page URL (in addressbar) without reloading the page.

Of course, you should really check out the original question.

The post Open messages in popup window – PHP [ANSWERED] appeared first on Tech ABC to XYZ.


Viewing all articles
Browse latest Browse all 31

Trending Articles