Jump to content


Getting one page to display an image linked by another

  • Please log in to reply
2 replies to this topic

#1 Squirrel86

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 15 November 2005 - 01:16 AM

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!)


#2 Squirrel86

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 16 November 2005 - 11:33 PM


It seems simple enough... :S

#3 redbullmarky

  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 13 January 2006 - 12:29 PM

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

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:

$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


"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users