Jump to content

Archived

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

Squirrel86

Getting one page to display an image linked by another

Recommended Posts

Honestly, I wouldn't know where to start a search on this one. I've looked through my DWMX04 Bible, a Google search, and... well, that's about it.

 

This has GOT to be an easy thing to do, I just don't know how to do it!

 

So anyhow, I'll start with an explanation of the intended result I'm after: A user clicks a thumbnail on one page, and the next shows the large version of the image, on a BUILT page, not just the image itself.

 

What I've got: an index.php in the root of my site that needs to tell image.php what image to display in the image display area.

 

I've got a MySQL database set up for the site, but I have NO IDEA what I'm doing with PHP coding or how to get the variables to work. (I could do this if I could write it in VB6 code! ARG!)

 

Anybody?

Share this post


Link to post
Share on other sites

[!--quoteo(post=319297:date=Nov 16 2005, 11:33 PM:name=.Squirrel)--][div class=\'quotetop\']QUOTE(.Squirrel @ Nov 16 2005, 11:33 PM) 319297[/snapback][/div][div class=\'quotemain\'][!--quotec--]

Anyone?

 

It seems simple enough... :S

 

ok, you may need to provide a bit more detail, but i'll have a bash, as it really depends how you've done things so far.

 

if you've literally hard coded the images into the index page (ie, youre not using a PHP loop to display the images) then each image could have a hyperlink such as:

 

<a href="image.php?image=a_picture.jpg"><img src="a_picture.jpg" /></a>

 

when you click this link, image.php will open and you'll see in the URL something like:

[a href=\"http://yoursite.com/image.php?image=a_picture.jpg\" target=\"_blank\"]http://yoursite.com/image.php?image=a_picture.jpg[/a]

 

in your image.php file, just put the image in like this:

 

<?php
$image = $_GET['image']; // gets the filename from URL
?>
   ** and put a line similar to this where you want your image to appear
<img src='<?php echo $image; ?>' />

 

that should set you on your way

 

cheers

mark

 

 

 

Share this post


Link to post
Share on other sites

×

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.