I have a front end form and want to retrieve user input vale using $_POST
in a variable. I had found similar threads here, but none of it couldn't solve my problem.
After accepting the variable in $data
, I tried to print using echo $data
. Nothing is shown. (But when I use other form input such as drop down or check box, $data
contains data. I require the button type as mentioned here and wont be able to change).
HTML Form
<html>
<body>
<form action="test_general.php" method="post" >
<input type="submit" name="btn" value="but1">text1</button>
<button type="submit" name="btn" value="but2">text2</button>
</form>
</body>
<html>
PHP processing code
<html>
<?php
$data = $_POST['value'];
echo $data;
?>
<html>