-
Notifications
You must be signed in to change notification settings - Fork 0
/
action2.php
59 lines (51 loc) · 1.87 KB
/
action2.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
include ('include/config.php');
//$e="em";
//echo '<script type="text/javascript">alert("' . $e . '")</script>';
extract($_REQUEST);
$name = $_GET['uname'];
$contact = $_GET['contact'];
//$address=$_GET['address'];
$email = $_GET['email'];
$type = $_GET['type'];
$msg = "hi";
$pid = $_GET['pid'];
/* $pass=$_GET['pass'];
$pass2=$_GET['pass2'];
$que=mysqli_query($con,"select * from users where email='$email'");
$row=mysqli_num_rows($que);
*/
$err = "";
if ($name == "" or $contact == "" or $email == "" or $type == "") {
$err = "All feilds should fill properly";
echo '<script type="text/javascript">alert("' . $err . '")</script>';
//header('location:User_registration.php');
}
/* if($pass2 != $pass)
{
$err="password and conferm password should match";
echo '<script type="text/javascript">alert("' . $err . '")</script>';
//header('location:User_registration.php');
}
if(strlen($contact)<10 or strlen($contact)>12 )
{
$err="Mobile number not proper";
echo '<script type="text/javascript">alert("' . $err . '")</script>';
//header('location:User_registration.php');
}
*/
if (strlen($err) < 5) {
$dt = date("Y/m/d");
$que = mysqli_query($con, "INSERT INTO `inquiry`(`name`, `subject`, `email`, `mobile`, `message`, `date`, `propertyId`) VALUES ('$name','$type','$email','$contact','$msg','$dt','$pid')");
// $row=mysqli_num_rows($que);
$msg = "Your Request Submited Successfully";
echo '<script type="text/javascript">alert("' . $msg . '"); window.location.href = "index.php"; </script>';
//sleep(1);
//header('location:User_Login.php');
} else {
$err = "somthing went wrong";
//echo '<script type="text/javascript">alert("' . $err . '")</script>';
echo '<script type="text/javascript">alert("' . $err . '"); window.location.href = "User_registration.php"; </script>';
//header('location:User_registration.php');
}
?>