Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <title>Registration</title>
- <script language="javascript" type="text/javascript">
- function clearText(field)
- {
- if (field.defaultValue == field.value) field.value = '';
- else if (field.value == '') field.value = field.defaultValue;
- }
- </script>
- </head>
- <body background-img="reg.jpg">
- <form action="recreg_post.php" method="post" onSubmit='return valid()'>
- <table width="600" align="center" height="400">
- <tr>
- <td colspan="2" align="center"></td>
- </tr>
- <tr bgcolor="#fffff">
- <td colspan="2" align="center">
- <font color="#ff0000" size="5"><marquee direction="right">REGISTRATION FORM FOR RECUITER</marquee></font>
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">UserName : </font>
- </td>
- <td>
- <input type="text" name="uname" id="uname" placeholder="Enter your Name">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Email Id : </font>
- </td>
- <td>
- <input type="text" name="email" id="email" placeholder="Enter your Mail ID">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Age</font>
- </td>
- <td>
- <input type="text" name="age" id="age" size="3" placeholder="Enter your age">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Gender</font>
- </td>
- <td>
- <font size="3" face="Times new roman">
- <select name="gender">
- <option value="none"> Please select any one</option>
- <option value="M"> Male </option>
- <option value="F"> Female </option>
- <option value="O"> Others </option>
- </select>
- </font>
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">City : </font>
- </td>
- <td>
- <input type="text" name="city" id="city" size="30" placeholder="Enter your Current city">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Mobile Number</font>
- </td>
- <td>
- <input type="text" name="mobile" id="mobile" size="10" placeholder="Enter your mobile number">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Aadhar no : </font>
- </td>
- <td>
- <input type="text" name="aadhar" id="aadhar" size="15" placeholder="Enter your Aadhar card number">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">About Yourself : </font>
- </td>
- <td>
- <textarea name="about" id="about" rows="5" cols="40" placeholder="Tell us something about you"></textarea>
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Create Password</font>
- </td>
- <td>
- <input type="password" name="password" id="pass" placeholder="Enter a password">
- </td>
- </tr>
- <tr>
- <td align="left">
- <font size="4">Confirm Password</font>
- </td>
- <td>
- <input type="password" name="cpassword" id="cpass" placeholder="Re-Enter the password">
- </td>
- </tr>
- <tr>
- <td colspan="2" align="center"><input type="submit" value="REGISTER">
- <input type='reset' name="clear" value="CLEAR">
- </td>
- </tr>
- </table>
- </form>
- </body>
- </html>
- </table>
- </form>
- </body>
- </html>
- <script type="text/javascript">
- function valid()
- {
- var uname = document.getElementById('uname').value;
- var email = document.getElementById('email').value;
- var age = document.getElementById('age').value;
- //var gen = document.getElementById('gen').value;
- var city = document.getElementById('city').value;
- var mobile = document.getElementById('mobile').value;
- var aadhar = document.getElementById('aadhar').value;
- var about = document.getElementById('about').value;
- var pass = document.getElementById('pass').value;
- var cpass = document.getElementById('cpass').value;
- //Validate UserName - Empty Check & Only 4 Characters Check
- if(uname == "")
- {
- alert("First Name should not be Empty!");
- return false;
- }
- var unm = /^[A-Za-z]{4,30}$/;
- if(!unm.test(uname))
- {
- alert("Invalid Name! Name should contain only characters and should contain a minimum of 4 characters & maximum of 30 characters");
- return false;
- }
- if(email == "")
- {
- alert("Email should not be Empty!");
- return false;
- }
- var atpos = email.indexOf("@"); //get the position of @ in the input email string
- var dotpos = email.lastIndexOf("."); //get the position (last occurrence) of .
- //Checks Min 2 chars in email name (ravi/abc12), domain name (gmail/yahoo) and domain type (.com/.net)
- if (atpos < 2 || dotpos <= atpos+2 || dotpos+2 >= email.length)
- {
- alert("In-valid E-mail Address!");
- return false;
- }
- //Validation of Age
- if(age == "")
- {
- alert("age should not be Empty!");
- return false;
- }
- if ( !( age > 1 && age<100 ) )
- {
- alert("The age must be a number between 1 and 100");
- return false;
- }
- //Validation of City
- if(city == "")
- {
- alert("city Name should not be Empty!");
- return false;
- }
- var cit = /^[A-Za-z ]{2,30}$/;
- if(!cit.test(city))
- {
- alert("Invalid City! City should contain only characters & spaces.and should contain a minimum of 3 characters & maximum of 30 characters");
- return false;
- }
- //Validation of Mobile
- if(mobile == "")
- {
- alert("Mobile should not be Empty!");
- return false;
- }
- var mb = /^[0-9]{10}$/; //match a value with exactly 10 digits
- if(!mb.test(mobile))
- {
- alert("Invalid Mobile Number! Enter a valid 10 Digit Mobile Number");
- return false;
- }
- //Validation of Aadhar
- if(aadhar == "")
- {
- alert("Aadhar Number should not be Empty!");
- return false;
- }
- var adhar = /^[0-9]{12}$/; //match a value with exactly 12 digits
- if(!adhar.test(aadhar))
- {
- alert("Invalid Aadhar Number! Enter a valid 12 Digit Mobile Number");
- return false;
- }
- //Validation of about
- if(about == "")
- {
- alert("About field should not be Empty!");
- return false;
- }
- //Validation of password
- if(pass == "")
- {
- alert("Password should not be Empty!");
- return false;
- }
- var pswd = /^[0-9A-Za-z@ ]{5,15}$/;
- if(!pswd.test(pass))
- {
- alert("Invalid Password! Password contain minimum 5 characters");
- return false;
- }
- if(pass!=cpass)
- {
- alert("given password is mismatch");
- return false;
- }
- return true;
- }
- </script>
- </body>
- </html>
- <html>
- <head>
- <title></title>
- </head>
- <body>
- <?php
- $uname = $_POST['uname'];
- $email = $_POST['email'];
- $age = $_POST['age'];
- $gender = $_POST['gender'];
- $city = $_POST['city'];
- $mobile = $_POST['mobile'];
- $aadhar = $_POST['aadhar'];
- $about = $_POST['about'];
- $password = $_POST['password'];
- $conn = new mysqli('localhost','root','','linking');
- mysqli_query($conn,"Insert into regrec (uname,email,age,gender,city,mobile,aadhar,about,password) values ('$uname','$email','$age','$gender','$city','$mobile','$aadhar','$about','$password')");
- echo "Registration Successfull";
- ?>
- </body>
- </html>
Add Comment
Please, Sign In to add comment