-
Notifications
You must be signed in to change notification settings - Fork 1
/
buissign_back.php
33 lines (26 loc) · 1.06 KB
/
buissign_back.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
<?php
include('Connect.php');
session_start();
if (isset($_POST['signup'])) {
$id = uniqid();
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$buisnesstype = $_POST['buisnesstype'];
$query1 = " SELECT * FROM `buisness` WHERE `email` = '$email' ";
$res1 = mysqli_query($Connect, $query1);
$data = mysqli_fetch_assoc($res1);
if (strcmp($data['email'], $email) == 0) {
echo ("<script>alert('Email is Already Registred!')</script>");
echo ("<script>window.location = 'buisnesslogin.php'</script>");
} else {
$query1 = "INSERT INTO `buisness`( `name`, `email`, `password`,`id`,`buisnesstype`) VALUES ('$name','$email','$password','$id','$buisnesstype')";
$res1 = mysqli_query($Connect, $query1);
echo ("<script>alert('You have Sucessfully Registred!')</script>");
echo ("<script>window.location = 'buisnesshome.php?id=$id'</script>");
}
} else {
echo ("<script>alert('Undefined action!')</script>");
echo ("<script>window.location = 'buisnesslogin.php'</script>");
}
?>