Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user registrtation html code:
- <html>
- <head>
- <title>user registration</title>
- </head>
- <body>
- <h2 align="center">User Registration Form</h2>
- <form name="form" method="post" action="xyz.php" enctype="multipart/form-data" align="center">
- NAME:
- <input type="text" name="name" size="25" maxlength="25"><br><br>
- ADDRESS:<br>
- <textarea name="address" cols="25" rows="4"> </textarea><br><br>
- Date of Birth:<br>
- <select name=birth_month><br>
- <option selected value=1>January
- <option value=2> February
- <option value=3>March
- <option value=4>April
- <option value=5>May
- <option value=6>June
- <option value=7>July
- <option value=8>August
- <option value=9>September
- <option value=10>October
- <option value=11>November
- <option value=12>December
- </select>
- <select name=birth_day><br>
- <option selected value=1>01
- <option value=2>02
- <option value=3>03
- <option value=4>04
- <option value=5>05
- <option value=6>06
- <option value=7>07
- <option value=8>08
- <option value=9>09
- <option value=10>10
- <option value=11>11
- <option value=12>12
- <option value=13>13
- <option value=14>14
- <option value=15>15
- <option value=16>16
- <option value=17>17
- <option value=18>18
- <option value=19>19
- <option value=20>20
- <option value=21>21
- <option value=22>22
- <option value=23>23
- <option value=24>24
- <option value=25>25
- <option value=26>26
- <option value=27>27
- <option value=28>28
- <option value=29>29
- <option value=30>30
- <option value=31>31</option>
- </select>
- <input maxlength=4 name=birth_year size=4><br><br>
- AGE:
- <input type="text" name="age" size="2"><br><br>
- AADHAAR Number:
- <input type="text" name="aadhaar" maxlength="12" size="12"><br><br>
- Gender:<br>
- <input type="radio" name="gender" value="M">Male
- <input type="radio" name="gender" value="F">Female
- <br><br><input type="submit" name="submit">
- </form>
- </body>
- </html>
- php code:
- <?php
- $servername="";
- $username="root";
- $password="";
- $db="test";
- $name = $_POST['name'];
- $address = $_POST['address'];
- $birth_month= $_POST['birth_month'];
- $birth_day = $_POST['birth_day'];
- $birth_year = $_POST['birth_year'];
- $gender = $_POST['gender'];
- $age=$_POST['age'];
- $aadhaar=$_POST['aadhaar'];
- $conn=mysqli_connect($servername,$username,$password,$db);
- $table="INSERT INTO user(name,address,birth_day,birth_month,birth_year,gender,age,aadhar) VALUES ('$name','$address','$birth_day','$birth_month','$birth_year','$gender','$age','$aadhaar')";
- ?>
- <html>
- <head>
- <title>Display Output </title>
- </head>
- <body>
- <h2> Dear
- <?php
- if ($gender=='M') {
- echo "Mr.";
- } elseif ($gender=='F') {
- echo "Ms.";
- }
- echo " ", $name;
- ?> ! You have entered the following information: </h2>
- <table border="1">
- <tr>
- <td>Address </td>
- <td>
- <?php echo $address; ?>
- </td>
- </tr>
- <tr>
- <td>Date of Birth </td>
- <td>
- <?php echo $birth_month, " ", $birth_day, " ", $birth_year; ?>
- </td>
- </tr>
- <tr>
- <td>Age</td>
- <td> <?php echo $age;?> </td>
- </tr>
- <tr>
- <td>Aadhaar</td>
- <td> <?php echo $aadhaar;?> </td>
- </tr>
- </table>
- </body>
- </html>
Add Comment
Please, Sign In to add comment