-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
29 lines (22 loc) · 859 Bytes
/
signup.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
<?php
include ("dbconnect.php");
$signupName = $_POST["signupName"];
$signupPhone = $_POST["signupPhone"];
$signupEmail = $_POST["signupEmail"];
$signupPassword = sha1($_POST["signupPassword"]);
$sql = "insert into user (name,email,phone) values ('$signupName','$signupEmail','$signupPhone')";
if ($conn->query($sql) === TRUE) {
$sql = "INSERT INTO login (username, password)VALUES ('$signupName','$signupPassword')";
if ($conn->query($sql) === TRUE) {
session_start();
$_SESSION["uname"] = $signupName;
echo "<script type='text/javascript'>alert('Sign up Successfull!'); "
. "window.location.href='http://localhost/FastFood/loguser.php';</script>";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>