Guest User

Untitled

a guest
Apr 10th, 2019
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <html>
  2. <?php>
  3. echo "welcome to php programming";
  4. ?>
  5. <body>
  6. <form action="begin.php" method="post">
  7. username:<input type="text" name="username"><br>
  8. password:<input type="password" name="password"><br>
  9. <input type="submit">
  10. </form></body></html>
  11. <?php
  12. $host='localhost:3306';
  13. $dname='dbname';
  14. $can=mysql_connect($host,'root','root') or die (mySql_user());
  15. $db=mySql_Select_db($dbname,$can) or die (mySql_error());
  16. $id=$_post['username'];
  17. $paid=$_post['password'];
  18. echo $id;
  19. if(!empty($_post['username']))
  20. {
  21. $query=mySql_query("select * from student") or die(mySql_error());
  22. $row=mySql_fetch_array($query) or die (mySql_error());
  23. if($row['name']=$id and $row['password']==$pwd)
  24. {
  25. echo "login successful";}
  26. else
  27. {
  28. echo "login failed ";
  29. }}
Add Comment
Please, Sign In to add comment