link with same url in php -


i have thumbnail images larger version.i placed thumbnail images in page.now link gave link

<a href="image/largerimage1.jpg"><img src="thumbnail1.jpg></a> 

but have make different pages showing larger one.i want give link show them in single page.means whenever click thumbnail open larger 1 in page same url name like

imagegallery.php?news=images/largerimage1/13.jpg imagegallery.php?news=images/largerimage1/14.jpg 

so how that?

pretty basic stuff, suggest read php tutorials on internet knowledge on 1 thing , another.

the ?news= part in url parameter can read php. type known $_get. part need $_get['news'] if we'd use first link , place inside script: echo $_get['news']; page images/largerimages1/13.jpg.

in order image loaded on website need simple steps, i'm changing news parameter image, suits better script since ain't news items:

<?php // define path (used see if image exists) $path = 'your/absolute/path/to/public_html/'; # or wwwroot or www folder // first check if parameter not empty if($_get['image'] != "") {   // check if file valid   if(file_exists($path . $_get['image'])) {     // if image exists display image     echo '<img src="'. $_get['image'] . '" />;   } } ?> 

below script can put thumbnails way want. ofcourse, these thumbnails there automated options. suggest @ script above , beginner php tutorials understand example given. still isn't best method, it's kicking in right direction.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -