My HTML code:
<form class="well" name="login" action="text.php" method="post" >
<input type="text" class="span3" id="username" name"username" placeholder="Enter your valid email">
<input type="text" class="span3" id="password" name"password" placeholder="Enter your password">
<button type="submit" class="btn" >Enzemble </button>
</form>
<h2>New User? ... Register</h2>
<form class="well" name="register" action="register.php" method="post" >
<input type="text" class="span3" id="email" name="email" placeholder="Enter your valid email" onBlur="emailValidation()">
<button type="submit" class="btn">Enter Enzemble!</button>
</form>
The bottom form works fine.
The top code gives "undefined index" notice and does not read values of username and password in text.php The text.php code:
<?php
if (isset($email)) $email=$_POST["username"];
if (isset($password)) $password=$_POST["pasword"];
echo "username " . $email . "password " . $password;
?>
The error: Notice: Undefined index: pasword in /home/nitin/www/enzemble/text.php on line 8 Notice: Undefined variable: email in /home/nitin/www/enzemble/text.php on line 9 username password
I am not getting html form values in php. This is surprising. I am working on it for a long time. Please help.