I am trying to run the below query which basically create a submit button. However when I am trying to click the Accept Request button it is not resolving the if condition and directly echo what is written in else condition. Can someone help why this would be happening?
<?php
if(isset($_POST['acceptrequest'.$user_from]))
{
echo "you are now freind !";
} else
{
echo 'Error in reading - acceptrequest'.$user_from;
}
?>
<form action = "friend_request.php" method = "POST">
<input type="submit" name = "acceptrequest<?php echo $user_from;?>"
value="Accept Request" style = "margin-left: 5px;" />
<input type="submit" name = "ignorerequest<?php echo $user_from;?>"
value="Ignore Request" style = "margin-left: 5px;" />
</form>