html - Php, How to pass address of a clicked image to another php file -
is there way in php when click on link, or image, address of image pass php page can use ?
i have code have gallery, , when people click on 1 of images in gallery want page opened sub images of project,
this general gallery view :
and when 1 of these images clicked on, need page opened, note each image on main gallery has own sub gallery.
i can in complete static method, need make dynamic..
so summary of question that, can possibly pass address of images on first gallery second gallery page can pull out images related gallery in database?
thanks in advance.
there many ways task.
one popular way pass image id or name through url this
<a href="page.php?photoid=1234"><img src="1234.jpg" /></a>
then use following code in page.php embed image.
<?php $photoid = isset($_request['photoid']) ? $_request['photoid'] : null; ?> <img src="<?php echo ($photoid != null) ? 'path/' . $photoid . '.jpg' : 'path/default.jpg'; ?>">
Comments
Post a Comment