Advertisement
Guest User

Untitled

a guest
Jan 10th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4.  
  5.  
  6.  
  7.  
  8. <?php
  9.  
  10. $db = mysql_connect("localhost","root","","dwexer2");
  11. if (!$db)
  12. {
  13. die('Could not connect: ' . mysql_error());
  14. }
  15.  
  16. mysql_select_db("dwexer2", $db);
  17.  
  18. $sql="INSERT INTO reg(user,pass,gender)
  19. VALUES
  20. ('$_POST[username]','$_POST[password]','$_POST[Gender]')";
  21.  
  22.  
  23.  
  24. if (!mysql_query($sql,$db))
  25.  
  26. {
  27.  
  28. die('Error: ' . mysql_error());
  29.  
  30. }
  31.  
  32. echo "1 record added";
  33.  
  34.  
  35.  
  36. mysql_close($db)
  37.  
  38. ?>
  39.  
  40. </body>
  41.  
  42. </html>
  43.  
  44.  
  45.  
  46. ********************
  47. <html>
  48. <head></head>
  49. <body> <form action="Dwexer4b.php" method="POST">
  50.  
  51. <h1>User Registration</h1>
  52.  
  53. <style>
  54. form { width: 450px; height:400; background-color:white;}
  55. label { float: left; width: 300px; }
  56. input[type=text] { float: left; width: 150px; }
  57. input[type=password] { float: left; width: 150px; }
  58. .gen { float: left; width: 1px; }
  59. .neg { float: left; width: 1px; }
  60. .clear { clear: both; height: 0; line-height: 0; }
  61. .a {visibility: hidden;}
  62. .sel { float: left; width: 150px; }
  63. input[type=checkbox] { float: left; width: 1px; }
  64. input[type=submit] { float: right; width: 150px;}
  65. </style>
  66.  
  67.  
  68. Please complete the following form to register with our site:<br><br>
  69.  
  70. <label for="username">UserName: </label> <input type="text" name="username"/><br/>
  71. <label for="password">Password: </label> <input type="password" name="password"/><br/>
  72. <br class="clear" />
  73. <br />
  74. <label for="gender">Gender: </label> <input type="radio" class="gen" name="Gender" value="Male">Male<br>
  75. <label for="female" class="a">Gender:</label> <input type="radio" class="neg" name="Gender" value="Female">Female<br><br>
  76. <label>How did you hear about us?:</label>
  77. <select value="Select answer" class="sel">
  78. <option value="Select Answer">Advertisment</option>
  79. <option>Internet</option>
  80. <option>News Paper</option>
  81. <option>Flyers</option>
  82. </select><br><br>
  83. <label>Please select this box if you wish</label><br>
  84. <label>to be added to our mailing list</label> <input type="checkbox"><br>
  85. <label>We will not pass on your details to any third party.</label><br><br>
  86. <input type="submit" value="Register now"/>
  87.  
  88. </form>
  89. </body>
  90. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement