-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinput.php
More file actions
27 lines (25 loc) · 748 Bytes
/
input.php
File metadata and controls
27 lines (25 loc) · 748 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
<?
$Username = $_POST["Username"];
$Password = $_POST["Password"];
//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, Password)
VALUES
('$Username',
'$Password')";
//declare in the order variable
$result = mysql_query($order); //order executes
if($result){
session_register("$Username");
session_register("$Password");
session_start();
header("location:users.php");
} else{
echo "You fucked up.";
//needs to check if register is good
}
?>