Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 skatermike21988

skatermike21988
  • Members
  • PipPipPip
  • Advanced Member
  • 100 posts
  • LocationFlorida

Posted 20 March 2006 - 04:49 AM

ok i have a shout box on my main page. i want to have an image at the top saying shout box and when clicked will echo the shout box and another to say member info that when clicked will display users member info or if not logged in echo not logged in etc.

how would i do this?

#2 skatermike21988

skatermike21988
  • Members
  • PipPipPip
  • Advanced Member
  • 100 posts
  • LocationFlorida

Posted 21 March 2006 - 06:09 AM

Any Help Anyone?

#3 redbullmarky

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

Posted 21 March 2006 - 08:46 AM

[!--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) View Post[/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.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#4 skatermike21988

skatermike21988
  • Members
  • PipPipPip
  • Advanced Member
  • 100 posts
  • LocationFlorida

Posted 23 March 2006 - 10:00 AM

[!--quoteo(post=356892:date=Mar 21 2006, 03:46 AM:name=redbullmarky)--][div class=\'quotetop\']QUOTE(redbullmarky @ Mar 21 2006, 03:46 AM) View Post[/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???

#5 redbullmarky

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

Posted 23 March 2006 - 10:18 AM

[!--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) View Post[/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:

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

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

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.
"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