I\'m trying to create a BMI calculator. This should allow people to use either metric or imperial measurements.
I realise that I could use hidden tags to solve my pr
For some reason, the name of the submit button is not passed to the superglobal $_POST
when submitted with Ajax/jQuery.
Just in case it helps someone...
The form name is not submitted. You should just add a hidden field to each form and call it a day.
You can use GET in the form's action parameter, which I use whenever I make a login/register combined page.
For example: action="loginregister.php?whichform=loginform"
Hope this helps!
To identify the submitted form, you can use:
The name of the form is not sent to the server as part of the POST data.
You can use code as followed
<form name="myform" method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="frmname" value=""/>
</form>
You can do it like this:
<input type="text" name="myform[login]">
<input type="password" name="myform[password]">
Check the posted values
if (isset($_POST['myform'])) {
$values = $_POST['myform'];
// $login = $values['login'];
// ...
}
You do realize that with echo $height; you are opening up a very, very serious security hole in your application, right?