-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfinish.php
More file actions
77 lines (57 loc) · 1.37 KB
/
Copy pathfinish.php
File metadata and controls
77 lines (57 loc) · 1.37 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
//STEP 1 Connect To Database
$connect = mysql_connect("mysql.quiando.com","asktheoracle","5|_|nburns");
if (!$connect)
{
die("MySQL could not connect!");
}
$DB = mysql_select_db('quiando');
if(!$DB)
{
die("My SQL could not select Database!");
}
//STEP 2 Declare Variables
$Name = $_POST['name'];
$Email = $_POST['email'];
$Email1 = "@";
$Email_Check = strpos($Email,$Email1);
$Password = $_POST['password'];
$Re_Password = $_POST['re-password'];
//STEP 3 Check To See If All Information Is Correct
if($Name == "")
{
die("Opps! You don't enter a Name!");
}
if($Password == "" || $Re_Password == "")
{
die("Opps! You didn't enter one of your passwords!");
}
if($Password != $Re_Password)
{
die("Ouch! Your passwords don't match! Try again.");
}
if($Email_Check === false)
{
die("Opps! That's not an email!");
}
//check if user already exists
$query = mysql_query("SELECT * FROM users WHERE email='$Email'");
if(mysql_num_rows($query) != 0)
{
header ("Location: register1.html");
}
else
{
//STEP 4 Insert Information Into MySQL Database
if(!mysql_query("INSERT INTO users (email, name, password)
VALUES ('$Email', '$Name', '$Password')"))
{
die("We could not register you due to a mysql error (Contact the website owner if this continues to happen.)");
}
// If The User Makes It Here Then That Means He Logged In Successfully
else{
header ("Location: main.html");
exit();
}
}
?>