Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <?php
- $db = mysql_connect("localhost","root","","dwexer2");
- if (!$db)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysql_select_db("dwexer2", $db);
- $sql="INSERT INTO reg(user,pass,gender)
- VALUES
- ('$_POST[username]','$_POST[password]','$_POST[Gender]')";
- if (!mysql_query($sql,$db))
- {
- die('Error: ' . mysql_error());
- }
- echo "1 record added";
- mysql_close($db)
- ?>
- </body>
- </html>
- ********************
- <html>
- <head></head>
- <body> <form action="Dwexer4b.php" method="POST">
- <h1>User Registration</h1>
- <style>
- form { width: 450px; height:400; background-color:white;}
- label { float: left; width: 300px; }
- input[type=text] { float: left; width: 150px; }
- input[type=password] { float: left; width: 150px; }
- .gen { float: left; width: 1px; }
- .neg { float: left; width: 1px; }
- .clear { clear: both; height: 0; line-height: 0; }
- .a {visibility: hidden;}
- .sel { float: left; width: 150px; }
- input[type=checkbox] { float: left; width: 1px; }
- input[type=submit] { float: right; width: 150px;}
- </style>
- Please complete the following form to register with our site:<br><br>
- <label for="username">UserName: </label> <input type="text" name="username"/><br/>
- <label for="password">Password: </label> <input type="password" name="password"/><br/>
- <br class="clear" />
- <br />
- <label for="gender">Gender: </label> <input type="radio" class="gen" name="Gender" value="Male">Male<br>
- <label for="female" class="a">Gender:</label> <input type="radio" class="neg" name="Gender" value="Female">Female<br><br>
- <label>How did you hear about us?:</label>
- <select value="Select answer" class="sel">
- <option value="Select Answer">Advertisment</option>
- <option>Internet</option>
- <option>News Paper</option>
- <option>Flyers</option>
- </select><br><br>
- <label>Please select this box if you wish</label><br>
- <label>to be added to our mailing list</label> <input type="checkbox"><br>
- <label>We will not pass on your details to any third party.</label><br><br>
- <input type="submit" value="Register now"/>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement