Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <html>
  2. <?php
  3. $a=$_post['name'];
  4. $b=$_post['passwd'];
  5. $dbhost="localhost";
  6. $db="mysql";
  7. $dbuser="root";
  8. $dbpassword="";
  9. $con=mysql_connect("localhost","root","");
  10. mysql_select_db($db);
  11. $sql="insert into demo1(name,password),values('$a' , '$b')";
  12. $res=mysql_query($sql);
  13. if(!res)
  14. {
  15. die(mysql_error());
  16. }
  17. else
  18. {
  19. $s="select *form user where name='$a' ";
  20. $res=mysql_query($s);
  21. while($r=mysql_fetch_array($res))
  22. {
  23. echo "name" .$r[0] ."<br/>";
  24. }
  25. }
  26. mysql_close($con);
  27. ?>
  28. <head>
  29. <title>
  30. php
  31. </title>
  32. </head>
  33. <body>
  34. <form method="post" action="">
  35. name:
  36. <input type="text" name="name" /> <br/>
  37. passwd:
  38. <input type="password" name="password" /> <br/>
  39. <input type="submit" name="submit">
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement