ZeroShade Posted December 10, 2006 Share Posted December 10, 2006 how can I say "if this link is clicked" in an if statement? Link to comment Share on other sites More sharing options...
The Praetorian Posted December 10, 2006 Share Posted December 10, 2006 Depending on what you want it to do when clicked, I think you're looking for javascript, not php. Specifically with javascript, the onclick function. Link to comment Share on other sites More sharing options...
ZeroShade Posted December 11, 2006 Author Share Posted December 11, 2006 Depending on what you want it to do when clicked, I think you're looking for javascript, not php. Specifically with javascript, the onclick function.I want to try and do it in php and stay away from javascript though. This is what i ahve so far... do u think it can be adapted because this isn't working...<?php $picture = "images\blue-carry.jpg"; echo "<a href='images\blue-carry.jpg?link = 1'><img src='$picture' border='0' /></a>"; if($_GET['link'] == 1) { $picture = "images\blue-ebook.jpg"; echo "<img src='$picture' border='0' />"; } ?> Link to comment Share on other sites More sharing options...
paramasivan Posted December 11, 2006 Share Posted December 11, 2006 I want to try and do it in php and stay away from javascript though. This is what i ahve so far... do u think it can be adapted because this isn't working...<?php $picture = "images\blue-carry.jpg"; echo "<a href='images\blue-carry.jpg?link = 1'><img src='$picture' border='0' /></a>"; if($_GET['link'] == 1) { $picture = "images\blue-ebook.jpg"; echo "<img src='$picture' border='0' />"; } ?> Anchor tag's href is an image is possible? Link to comment Share on other sites More sharing options...
justsomeguy Posted December 11, 2006 Share Posted December 11, 2006 echo "<a href='images\blue-carry.jpg?link = 1'><img src='$picture' border='0' /></a>"; if($_GET['link'] == 1)That is correct, but don't have spaces in the URL. The equal sign should follow the name, and the value should follow the equal.images\blue-carry.jpg?link=1But, the link you have there is a jpg, not a php file. jpg files do not get sent to the PHP engine (and shouldn't), so PHP will not have access to that variable.What are you trying to do? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now