Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Information in Address 1

Status
Not open for further replies.

lucidity23

Programmer
Feb 14, 2001
99
0
0
US
Ok...

I used to know how to do this, but it has been awhile. I have an image gallery I am trying to create. What I want to do is just have the images in the various galleries as thumbnails. Then 1 template page that they are loaded to when clicked on.

So if u click on a thumbnail, a page loads, showing the pic. But instead of having a page for EVERY pic, I thought I could just have 1 page that the thumbnail would tell the page which pic to show when it is clicked.

Any thoughts? It can be in ASP, Javascript, whatever... :)
 
It's very easily done in PHP and probably other scripting languages as well.

On the link for each thumbnail you can do something like:
Code:
<a href="yourscript.xyz?pic=picid"><img ...>
In your "yourscript.xyz" you would get and display the picture referenced by "picid".

I wrote one using PHP to display most of my digital pictures (and some scanned negatives and slides from many years ago). You can see it in action at It works best with the latest browsers, since I use CSS menues. Javascript needs to be turned on if you use MSIE.

Ken
 
Try this

on the thumbnail page have something like this
-----------------------------------------
<a href=showpic.html?picture1.jpg>
<img src=thumbnail1.jpg>
</a>
<a href=showpic.html?picture2.jpg>
<img src=thumbnail2.jpg>
</a>
<a href=showpic.html?picture3.jpg>
<img src=thumbnail4.jpg>
</a>
-----------------------------------------

and then have a showpic.html file like this-

-----------------------------------------
<table>
<tr>
<td bgcolor=blue><h1>Selected Picture</h1>
<tr>
<td>
<script>
var url = document.location.href
url = document.location.href.split("?")
document.writeln("<img src=" + url[0] +">")
</script>
</table>
-----------------------------------------
 
Thanks to u both!! :)

Matt, What you posted worked, but I needed to change 2 things

I made it url[1] instead of url[0]

also I specified the scripting language as Javascripting.

It works though!!

thanks!!


- carpe diem -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top