Guest User

Untitled

a guest
Mar 3rd, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2. include ('config.php');
  3. if(isset($_POST['register'])) {
  4.  
  5. $username = "$_POST(':username')";
  6. $password = "$_POST(':password')";
  7. //$encrypted_password = md5($password);
  8. try {
  9. $sql = "INSERT INTO members (username, password) VALUES(:username, :password)";
  10. $count = $dbconnect->prepare($sql);
  11. $count->execute(array(':username' => $username, ':password' => $password));
  12. }
  13. catch(PDOException $e)
  14. {
  15. echo $e->getMessage();
  16. }
  17.  
  18. }
  19. ?>
  20.  
  21. <html>
  22. <head>
  23. <title></title>
  24. </head>
  25. <body>
  26. <form method="post" action="">
  27. <table border="0">
  28.  
  29. <tr><td>Username </td><td><input type="text" name="username" size="15" /></td></tr>
  30.  
  31. <tr><td>Password </td><td><input type="password" name="password" size="20" /></td></tr>
  32.  
  33. <tr><td></td><td><input type="submit" value="Submit" name='register'/></td></tr>
  34.  
  35. </table>
  36. </form>
  37. </body>
  38. </html>
Add Comment
Please, Sign In to add comment