-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreg_Pvalidation.php
46 lines (33 loc) · 1.58 KB
/
reg_Pvalidation.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
<?php
//connect to database
$connection=mysqli_connect("localhost","root","","zomato");
$name=$_POST['user_ka_name'];
$email=$_POST['user_ka_email'];
$reason=$_POST['user_ka_reason'];
$password=$_POST['user_ka_password'];
$phone=$_POST['user_ka_phone'];
$uploadCv = 'restaurant/cover/';
$uploadCover = $uploadCv . basename($_FILES['restaurant_ka_photo']['name']);
$uploadPr = 'restaurant/';
$uploadProfile = $uploadPr . basename($_FILES['user_ka_photo']['name']);
$Rname=$_POST['restaurant_ka_name'];
$Rrating=$_POST['restaurant_ka_rating'];
$Rcuisine=$_POST['restaurant_ka_cuisine'];
$query3="SELECT * FROM `restaurant` WHERE `p_email` LIKE '$email'";
$result=mysqli_query($connection,$query3);
if ((move_uploaded_file($_FILES['user_ka_photo']['tmp_name'], $uploadProfile)) && (move_uploaded_file($_FILES['restaurant_ka_photo']['tmp_name'], $uploadCover))) {
$result=mysqli_fetch_assoc($result);
if(count($result)==11){
header('Location:index.php?msg=4');
}else{
$query="INSERT INTO `restaurant` (`r_id`, `p_name`, `p_email`, `p_about`, `p_password`, `p_phone`, `p_image`, `r_name`, `r_rating`, `r_cuisine`, `r_bg`) VALUES (NULL, '$name', '$email', '$reason', '$password', '$phone', '$uploadCover', '$Rname', '$Rrating', '$Rcuisine', '$uploadProfile')";
if(mysqli_query($connection,$query)){
//You have to made your resstaurant...
header('Location:restaurant.php');
}else{
//echo "Some error occured";
header('Location:index.php?msg=5');
}
}
}
?>