In my HTML i have the image type of a submit button but i dont seem to get the value of the button.
<html>
<head>
<title>Title</title>
</head>
<body>
<form name="myform" action = "wala.php" method = "post">
<input type="image" src="image1.png" name="buttonsend" value = "button1">
<input type="image" src="image2.png" name="buttonsend" value = "button1">
</form>
</body>
</html>
wala.php:
<?php
if(isset($_POST['buttonsend']))
{
if($_POST['buttonsend']=='button1')
{
print "You have clicked save button"."<br>";
}
if($_POST['buttonsend']=='button2'){
print "You have clicked search button";
}
}
?>
I'm always getting "You have clicked save button" no matter which button i clicked.
Any Idea how to get the value of the image type button?