1<html>
2<head>
3<title>PHP User Registration Form</title>
4<link href="./css/style.css" rel="stylesheet" type="text/css" />
5</head>
6<body>
7 <form name="frmRegistration" method="post" action="">
8 <div class="demo-table">
9 <div class="form-head">Sign Up</div>
10
11<?php
12if (! empty($errorMessage) && is_array($errorMessage)) {
13 ?>
14 <div class="error-message">
15 <?php
16 foreach($errorMessage as $message) {
17 echo $message . "<br/>";
18 }
19 ?>
20 </div>
21<?php
22}
23?>
24 <div class="field-column">
25 <label>Username</label>
26 <div>
27 <input type="text" class="demo-input-box"
28 name="userName"
29 value="<?php if(isset($_POST['userName'])) echo $_POST['userName']; ?>">
30 </div>
31 </div>
32
33 <div class="field-column">
34 <label>Password</label>
35 <div><input type="password" class="demo-input-box"
36 name="password" value=""></div>
37 </div>
38 <div class="field-column">
39 <label>Confirm Password</label>
40 <div>
41 <input type="password" class="demo-input-box"
42 name="confirm_password" value="">
43 </div>
44 </div>
45 <div class="field-column">
46 <label>Display Name</label>
47 <div>
48 <input type="text" class="demo-input-box"
49 name="firstName"
50 value="<?php if(isset($_POST['firstName'])) echo $_POST['firstName']; ?>">
51 </div>
52
53 </div>
54 <div class="field-column">
55 <label>Email</label>
56 <div>
57 <input type="text" class="demo-input-box"
58 name="userEmail"
59 value="<?php if(isset($_POST['userEmail'])) echo $_POST['userEmail']; ?>">
60 </div>
61 </div>
62 <div class="field-column">
63 <div class="terms">
64 <input type="checkbox" name="terms"> I accept terms
65 and conditions
66 </div>
67 <div>
68 <input type="submit"
69 name="register-user" value="Register"
70 class="btnRegister">
71 </div>
72 </div>
73 </div>
74 </form>
75</body>
76</html>
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5<title>Registration Form</title>
6<style>
7input,textarea{width:200px}
8input[type=radio],input[type=checkbox]{width:10px}
9input[type=submit],input[type=reset]{width:100px}
10</style>
11</head>
12
13<body>
14<form method="post" enctype="multipart/form-data">
15<table width="393" border="1">
16 <tr>
17 <td colspan="2"><?php echo @$msg; ?></td>
18 </tr>
19 <tr>
20 <td width="159">Enter your Name</td>
21 <td width="218">
22 <input type="text" placeholder="your first name" name="n" pattern="[a-z A-Z]*" required /></td>
23 </tr>
24 <tr>
25 <td>Enter your Email</td>
26 <td><input type="email" name="e"/></td>
27 </tr>
28 <tr>
29 <td>Enter your Password</td>
30 <td><input type="password" name="p"/></td>
31 </tr>
32 <tr>
33 <td>Enter your Address</td>
34 <td><textarea name="add"></textarea></td>
35 </tr>
36 <tr>
37 <td>Enter your Mobile</td>
38 <td><input type="text" pattern="[0-9]*" name="m" /></td>
39 </tr>
40 <tr>
41 <td height="23">Select your Gender</td>
42 <td>
43 Male<input type="radio" name="g" value="m"/>
44 Female<input type="radio" name="g" value="f"/>
45 </td>
46 </tr>
47 <tr>
48 <td>Choose your Hobbies</td>
49 <td>
50 Cricket<input type="checkbox" value="cricket" name="hobb[]"/>
51 Singing<input type="checkbox" value="singing" name="hobb[]"/>
52 Dancing<input type="checkbox" value="dancing" name="hobb[]"/>
53 </td>
54 </tr>
55 <tr>
56 <td>Choose your Profile Pic </td>
57 <td><input type="file" name="pic"/></td>
58 </tr>
59 <tr>
60 <td>Select your DOB</td>
61 <td>
62 <select name="mm">
63 <option value="">Month</option>
64 <?php
65 for($i=1;$i<=12;$i++)
66 {
67 echo "<option value='$i'>".$i."</option>";
68 }
69 ?>
70 </select>
71 <select name="dd">
72 <option value="">Date</option>
73 <?php
74 for($i=1;$i<=31;$i++)
75 {
76 echo "<option value='$i'>".$i."</option>";
77 }
78 ?>
79 </select>
80 <select name="yy">
81 <option value="">Year</option>
82 <?php
83 for($i=1900;$i<=2015;$i++)
84 {
85 echo "<option value='$i'>".$i."</option>";
86 }
87 ?>
88 </select>
89 </td>
90 </tr>
91 <tr>
92 <td colspan="2" align="center">
93 <input type="submit" name="save" value="Register Me"/>
94 <input type="reset" value="Reset"/>
95 </td>
96 </tr>
97</table>
98</form>
99</body>
100</html>
101