Guest User

Untitled

a guest
Nov 3rd, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <?php
  3.  
  4. $dbhost = 'localhost';
  5. $dbuser = 'freeload_retain';
  6. $dbpass = '';
  7. $db = 'freeload_retain';
  8.  
  9. $dbconn = mysql_connect($dbhost, $dbuser,
  10. $dbpass);
  11. mysql_select_db($db);
  12.  
  13.  
  14.  
  15. if (isset($_POST['submit']))
  16. {
  17. $comapnyname = $_POST['companyname'];
  18. $username = $_POST['username'];
  19. $password = $_POST['password'];
  20. $email = $_POST['email'];
  21.  
  22. $query = ("INSERT INTO clients
  23. ([cname], [tname], [pname], [ename]) VALUES
  24. ('$companyname','$username','$password',
  25. '$email ')");
  26.  
  27. if(mysql_query($query))
  28. {
  29. echo "<script>alert('INSERTED
  30. SUCCESSFULLY');</script>";
  31. }
  32. else
  33. {
  34. echo "<script>alert('FAILED TO INSERT');
  35. </script>";
  36. }
  37.  
  38. }
  39. ?>
  40.  
  41. <html>
  42. <head>
  43. <meta charset="UTF-8">
  44. <title>sample</title>
  45. </head>
  46. <body>
  47. <form action="" method = "POST">
  48.  
  49. Companyname:
  50. &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
  51. &nbsp; &nbsp; &nbsp; &nbsp;
  52. &nbsp; &nbsp;
  53. Username:
  54. &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
  55. &nbsp; &nbsp; &nbsp; &nbsp;
  56. Password:<br>
  57. <input name="Comapnyname"
  58. size="15" style="height: 19px;"
  59. type="text" required>
  60. &nbsp; &nbsp; &nbsp;
  61. <input name="Username" size="15"
  62. style="height: 19px;" type="text"
  63. required>
  64. &nbsp; &nbsp; &nbsp;
  65. <input name="Password" size="15"
  66. style="height: 19px;" type="text"
  67. required>
  68.  
  69. <br><br>
  70.  
  71. Email Address:<br>
  72. <input name="email" type="text"
  73. required placeholder="Enter A Valid Email
  74. Address" style="height: 19px;" size="30">
  75. <br><br>
  76. <br><br>
  77.  
  78. <br>
  79. <br>
  80.  
  81. <button type ="submit" name="submit"
  82. value="send to database"> SEND TO DATABASE
  83. </button>
  84. </form>
  85. </body>
  86. </html>
Add Comment
Please, Sign In to add comment