Jump to content

Clicking a link for something to happen


ZeroShade

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...