-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreg_dbms.php
36 lines (36 loc) · 1011 Bytes
/
reg_dbms.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
<?php
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$phone=$_POST['phone'];
$email=$_POST['Email'];
$food=$_POST['food'];
$p1=$_POST['Password'];
$p2=$_POST['cPassword'];
if(isset($_POST['submit']))
{
include('connect.php');
if($p1==$p2)
{
$qry="insert into bakery (FirstName, LastName, PhoneNumber, Email, Food, Password) values('$fname','$lname','$phone','$email','$food','$p1')";
if(mysqli_query($conn,$qry))
{
session_start();
$_SESSION['user']=$email;
echo '<script>alert("Welcome to The Warm Delights. # Successful.")</script>';
header("refresh:0; url=http://localhost/Bakery/index1.php");
}
else
{
echo mysqli_error($conn);
echo '<script>alert("Already Register. Please click on Login")</script>';
header("refresh:0; url=http://localhost/Bakery/register.php");
}
}
else
{
echo '<script>alert("Your Password and confirm is not same. Please check it.")</script>';
header("refresh:0; url=http://localhost/Bakery/register.php");
}
mysqli_close($conn);
}
?>