Forum Moderators: open

Message Too Old, No Replies

passing a value from one page to another

         

zigmeister

5:53 am on Nov 18, 2004 (gmt 0)

10+ Year Member



little help! ..... please? i have an array of thumbnail images and i want to pass the thumbnail image number to the next page so that i can display the corresponding bigger picture, i will thank you in advance for any suggestions

the zigmeister has spoken..

dreamcatcher

9:42 am on Nov 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think this post is in the wrong section. Maybe one of the mods will move it to the PHP section, which is probably what you want.

An easy way is to use a query string:

<a href="yoursite.com.php?id=1">Click for Big Picture</a>

If you are using a database, you could query the database based on the id. Or an alternative is to use the image name in the link:

<a href="yoursite.com.php?id=picture.jpg">Click for Big Picture</a>

Again, use the value of id to get your big picture.

if (isset($_GET['id']))
{
$id = $_GET['id'];

echo "<img src=\"" . $id . "\" border=\"0\">\n";

}

Hope that helps. :)

zigmeister

3:38 pm on Nov 18, 2004 (gmt 0)

10+ Year Member



thank you dreamcatcher!
beautiful code... i am trying to utilize client-side javascript and html to perform this action. is there a way to pass a value from one page to the next using just javascript and/or forms? i could swear i've done it before but i can't remember how.