Jump to content

!HELP! Popup window like facebook photos


phpnewbei

Recommended Posts

I need help with my webpage here, how do you get so if you are at http://www.blabla.com/account.php and then click on a photo, it will go to www.blabla.com/photo.php?id=1 but still be at account.php? Just like facebook shows their photos. I dont know how to think nor to get it work. Would appreciate some help!

 

ThNXX 1n 4dv4nc3 // Machram!

Link to comment
https://forums.phpfreaks.com/topic/246774-help-popup-window-like-facebook-photos/
Share on other sites

Thanks for a fast reply! That was what I was looking for, but do you know if I can use MySQL commands in there also? Cuz it's pretty much needed :) I'm going to use it for a photo that you can choose to make as profile picture :P

 

In the meantime, i'll try to fix it on my own!

 

Thanks in advance! / Machram

I don't go on Facebook very often (or are even able to access it at this moment), but somewhere in the URL they will have a hash. The hash allows you to alter the address without actually navigating away from the page. Only newer browsers support an event to to detect said changes, but there's a jQuery plug-in available that will make it all effortless, and also allow you to support the back-button navigation.

 

Just note that whatever appears in the hash is not sent to the web server - i.e. you can't get the value of it within PHP.

If it was to just open up a large picture you wouldn't need 'SQL commands' within the said window...

 

although if it was a specific persons profile picture just to enlarge you could get the image from the database and just put it in the path:

 

off the top of the head i can't remember exactly how to reference orange box but you would do this to get your picture (only as an example)

 

$sql = 'SELECT image FROM profiles WHERE username "' . $_GET['userid'] . '"';

 

// userID would be in the query string in the URL

 

// fetch the array from the SQL

$row = mysql_fetch_array($sql);

 

and this would be the html for the image tag to actually call in your own image from database...

 

<img src="/path/images/<?= $row['image']; ?>" >

phpnewbei, i know what you are trying to do. you want to do a fanybox/lightbox something similar to facebook photo view and the url changes to the photo url with the page actually redirecting. i was also trying to achieve the same thing...

phpnewbei, i know what you are trying to do. you want to do a fanybox/lightbox something similar to facebook photo view and the url changes to the photo url with the page actually redirecting. i was also trying to achieve the same thing...

 

Have a look at the jQuery plug-in I linked to.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.