Jump to content

Useing An Image As A Link Then If statement for that image


skatermike21988

Recommended Posts

[!--quoteo(post=356869:date=Mar 21 2006, 06:09 AM:name=Skater Mike)--][div class=\'quotetop\']QUOTE(Skater Mike @ Mar 21 2006, 06:09 AM) [snapback]356869[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Any Help Anyone?
[/quote]

you could make a link from the image which re-calls the page with a URL parameter that, when detected, shows the relevent details, using $_GET

or you could preload the info within a hidden table/div tag and use javascript to reveal it when the image is clicked.
Link to comment
Share on other sites

[!--quoteo(post=356892:date=Mar 21 2006, 03:46 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Mar 21 2006, 03:46 AM) [snapback]356892[/snapback][/div][div class=\'quotemain\'][!--quotec--]
you could make a link from the image which re-calls the page with a URL parameter that, when detected, shows the relevent details, using $_GET

or you could preload the info within a hidden table/div tag and use javascript to reveal it when the image is clicked.
[/quote]
Could You Give Me An Example Code For That???
Link to comment
Share on other sites

[!--quoteo(post=357533:date=Mar 23 2006, 10:00 AM:name=Skater Mike)--][div class=\'quotetop\']QUOTE(Skater Mike @ Mar 23 2006, 10:00 AM) [snapback]357533[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Could You Give Me An Example Code For That???
[/quote]

without knowing exactly how you have things set up, it'd be awkward to do the code for you. but for example:

[code]
<?php
if (isset($_GET['foo']))
{
   echo 'foo is '.$_GET['foo'];
}
?>

<a href="<?php echo $_SERVER['PHP_SELF'];?>?foo=bar"<img src="myimage.jpg" /></a>
[/code]

if you clicked the image, it would reload the current page with ?foo=bar in your URL, which you can then get at with $_GET['foo']

as for javascript, that's a different story and one for the javascript forum, but basically you load all the info you need into a table with the CSS style 'display:none', and when the image is clicked (using onClick) it sets the CSS style of the table so that it shows.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.