php - $_post does not contain anything -


i trying login seems variables dont contain anthing. encountered problem before managed fix , name attribute missing in html form time..but time don't know doing wrong .plz help?

here html snippet. returning blank after submit:

 <form action="onlogin.php" method="post">                 <h1>login form</h1>                 <div>                     <input type="text" placeholder="username" required="" name="username" />                 </div>                 <div>                     <input type="password" placeholder="password" required="" name="password" />                 </div>                 <div>                     <input type="submit" value="log in" />                     <a href="#">lost password?</a>                     <a href="signup.html">register</a>                 </div>             </form> 

and php snippet is:

    <?php       include ("config/config.php");//connects db       if(isset($_post["submit"]))        {        $username =  $_post['username']; echo "$username";        $password =  $_post['password']; echo "$password";        }     ?>*** 

you check $_post["submit"] submit isset or not in php script. don't send form.

try this:

<form action="onlogin.php" method="post">     <h1>login form</h1>     <div>         <input type="text" placeholder="username" required="" name="username" />     </div>     <div>         <input type="password" placeholder="password" required="" name="password" />     </div>     <div>         <input type="submit" name="submit" value="log in" />         <a href="#">lost password?</a>         <a href="signup.html">register</a>     </div> </form> 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -