Advertisement
Guest User

Untitled

a guest
Nov 28th, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <form action = "insertform.php" method="post">
  6. Username: <input type="text" name="username"><br />
  7. Password: <input type="text" name="password"><br />
  8. <input type="submit" name="submit">
  9. </form>
  10.  
  11. <?php
  12. if(isset($_POST['submit'])){
  13.  
  14. $con = mysql_connect("localhost","Steven","password");
  15. if(!$con){
  16. die("Can not connect:" . mysql_error());
  17. }
  18.  
  19.  
  20. mysql_select_db("credentials",$con);
  21.  
  22. $sql = "INSERT INTO employees (Username,Password) VALUES('$_POST[username]','$_POST[password]')";
  23.  
  24. mysql_query($sql,$con);
  25.  
  26.  
  27. mysql_close($con);
  28. }
  29. ?>
  30.  
  31.  
  32. </body>
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement