-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration_check.php
More file actions
31 lines (30 loc) · 880 Bytes
/
registration_check.php
File metadata and controls
31 lines (30 loc) · 880 Bytes
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
<?
$Username = $_POST["Username"];
$Page = $_POST["Page"];
//the example of inserting data with variable from HTML form
//input.php
mysql_connect('mysql-user-master.stanford.edu', 'ccs147goizueta', 'nookohte');//database connection
mysql_select_db("c_cs147_goizueta");
//inserting data order
$order = "INSERT INTO Users
(Username)
VALUES
('$Username')";
//declare in the order variable
$result = mysql_query($order); //order executes
if($result){
session_start();
$_SESSION["Username"] = $Username;
if ($Page == "Welcome") {
header("location:loggedIn.php");
} else if ($Page == "Pinch") {
header("location:pinch.php");
}
} else{
if ($Page == "Welcome") {
header("location:index.php");
} else if ($Page == "Pinch") {
header("location:loginPinch.php");
}
}
?>