What makes PHP unset form variables? -
my html code:
<form class="well" name="login" action="text.php" method="post" > <input type="text" class="span3" id="username" name"username" placeholder="enter valid email"> <input type="text" class="span3" id="password" name"password" placeholder="enter 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 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 , not read values of username , password in text.php 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 not getting html form values in php. surprising. working on long time. please help.
you have syntax error in html code. it's missing = name attribute of input fields:
<input type="text" class="span3" id="username" name"username" placeholder="enter valid email"> here ----------------------------------------------^
Comments
Post a Comment