Page 1 of 1

hyperlink to php file

Posted: Tue Mar 27, 2007 6:08 am
by CarlosB
I know this is basic, but i have no idea on how to fix this! I have an image in a html page, and i wanto to make a link to a php page when you click on it. I have done it thousands of times, but now it just won't work =S when i click on the image it appear a window asking me if i wan't to download the php file! This is the code i'm using:

<img src="img/enviar.jpg" border="0" onClick="document.enviar.submit();">

Can anybody help me? Thanks!

Posted: Tue Mar 27, 2007 6:23 am
by Chris Corbyn
If you're being asked to download the PHP file then it will be linking to it, but the server is doing something wrong. Have you tried going directly to the PHP file in your browser?

By the way, you can have <input type="image" src="... " />

Posted: Tue Mar 27, 2007 10:23 am
by aaronhall
If that image isn't being used to submit a form, you should wrap the image in an anchor tag, sans the javascript:

Code: Select all

<a href="something.php"><img src="asdf.jpg" border="0" /></a>