Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('DB_HOST', 'localhost');
- define('DB_NAME', 'housemaker');
- define('DB_USER','root');
- define('DB_PASSWORD','');
- $con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
- $db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
- function NewUser() {
- $fullname = $_POST['name'];
- $category = $_POST['cat'];
- $email = $_POST['email'];
- $phone = $_POST['phone'];
- $address1 = $_POST['address1'];
- $address2 = $_POST['address2'];
- $address3 = $_POST['address3'];
- $location=$_POST['location'];
- $pincode = $_POST['pincode'];
- $city = $_POST['city'];
- $password = $_POST['password'];
- $password = md5($password);
- $query = "INSERT INTO `temp-registration`(`name`, `cat`, `email`, `phno`, `add_line1`, `add_line2`, `add_line3`, `location`, `pincode`, `city`, `password`) VALUES ('$fullname','$category','$email','$phone','$address1','$address2','$address3','$location','$pincode','$city','$password')";
- $data = mysql_query ($query)or die(mysql_error());
- if($data) {
- echo "YOUR REGISTRATION IS COMPLETED. PLEASE WAIT UNTIL ADMIN VERIFIES YOUR DETAILS";
- header("refresh:5;url=index.php");
- }
- }
- function SignUp() {
- if(!empty($_POST['email'])) //checking the 'user' name which is from Sign-Up.html, is it empty or have some text
- {
- $email = $_POST['email'];
- $query = "SELECT * FROM `provider-registration` WHERE email = '$email'";
- $query_exe=mysql_query($query) or die(mysql_error());
- //echo $query;
- if(!$row = mysql_fetch_array($query_exe) or die(mysql_error())) {
- newuser();
- }
- else {
- echo "SORRY...YOU ARE ALREADY REGISTERED USER..."; }
- }
- }
- if(isset($_POST['submit'])) { SignUp(); }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement