Jump to content

Form Image As Button : Not Working


Cooper94

Recommended Posts

I have created a html form that when the image is pressed it will echo somthing out. But the code that is below seems to not work for what ever reason. I thank you all for your help and for your time!

 

<form action="" method="POST">
<center>
<table>
<tr>
<td>Callsign:</td> <td><input type="text" name="username" value="RPA" size="10" style="width: 79px;" /></td>
</tr>

<tr>
<td>Password:</td> <td><input type="password" name="password" size="10" max-size="5" /></td>
</tr>

<tr>
<td><input name="login" type="image" src="images/login.png" width="58" height="20"></td>
</tr>
</table>
</center>
</form>


<?php 
if(isset($_POST['login'])) { 
echo "lol";

}
?>

Link to comment
https://forums.phpfreaks.com/topic/193509-form-image-as-button-not-working/
Share on other sites

Images as submit buttons send the x,y coordinates where they were clicked on, per the W3.org specification. See this link how that can be accessed in php code - http://us3.php.net/manual/en/faq.html.php#faq.html.form-image

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.