Guest User

Untitled

a guest
Dec 14th, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>RegPage</title>
  5. </head>
  6. <body>
  7.  
  8. <form action ="bb.php" method="post">
  9. name: <input type="text" name "username">
  10. <br/>
  11. email: <input type="text" name ="email">
  12. <br/>
  13. password: <input type="password" name="password">
  14.  
  15. <input type = "submit" value = "insert">
  16.  
  17. </form>
  18.  
  19. </body>
  20. </html>
  21.  
  22. <?php
  23. $con=mysqli_connect('localhost','root','');
  24.  
  25. if(!con)
  26. {
  27. echo 'not connected to server';
  28. }
  29.  
  30. if (!mysqli_select_db ($con,'pilot'))
  31. {
  32. echo 'database not selected';
  33. }
  34.  
  35. $name=$_post['username'];
  36. $email=$_post['email'];
  37. $password=$_post['password'];
  38.  
  39. $sql="insert into dbinvestor (email,password,name) values ('$email','$password', '$name')";
  40.  
  41. if (!mysqli_query($con,$sql))
  42. {
  43. echo 'not inserted';
  44. }
  45. else
  46. {
  47. echo 'inserted succesfuly';
  48. }
  49.  
  50. header ("refresh:2;url=aa.html");
  51. ?>
Add Comment
Please, Sign In to add comment