skatermike21988 Posted March 20, 2006 Share Posted March 20, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/5329-useing-an-image-as-a-link-then-if-statement-for-that-image/ Share on other sites More sharing options...
skatermike21988 Posted March 21, 2006 Author Share Posted March 21, 2006 Any Help Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/5329-useing-an-image-as-a-link-then-if-statement-for-that-image/#findComment-19244 Share on other sites More sharing options...
redbullmarky Posted March 21, 2006 Share Posted March 21, 2006 [!--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 $_GETor you could preload the info within a hidden table/div tag and use javascript to reveal it when the image is clicked. Quote Link to comment https://forums.phpfreaks.com/topic/5329-useing-an-image-as-a-link-then-if-statement-for-that-image/#findComment-19267 Share on other sites More sharing options...
skatermike21988 Posted March 23, 2006 Author Share Posted March 23, 2006 [!--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 $_GETor 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??? Quote Link to comment https://forums.phpfreaks.com/topic/5329-useing-an-image-as-a-link-then-if-statement-for-that-image/#findComment-19886 Share on other sites More sharing options...
redbullmarky Posted March 23, 2006 Share Posted March 23, 2006 [!--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]<?phpif (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. Quote Link to comment https://forums.phpfreaks.com/topic/5329-useing-an-image-as-a-link-then-if-statement-for-that-image/#findComment-19888 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.