-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsignup.php
56 lines (48 loc) · 1.12 KB
/
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
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
<?php
session_start();
$id =$_SESSION['id'];
$username =$_SESSION['username'];
if(!isset($_SESSION['id']))
{
header('Location: http://localhost/projj/index.php?error=1');
}
?>
<?php
$connection = mysql_connect("localhost", "root", "");
if(!$connection)
{
die("Server connection failed server might be too busy try again!");
}
?>
<?php
$dbselect = mysql_select_db("friend",$connection);
if(!$dbselect)
{
die("Database selection failed server might be too busy try again! ");
}
?>
<?php
/* @var $uname callable */
$uname= $_POST["usernamesignup"];
/* @var $email type */
$email= $_POST["emailsignup"];
$password= $_POST["passwordsignup"];
$cpassword= $_POST["passwordsignup_confirm"];
//echo $uname.$email.$password.$cpassword;
$result = mysql_query("SELECT * FROM `basic` WHERE 1",$connection);
if(!$result) // if not result die page
{
die(" query failed Sorry server might be too busy try again!");
}
else
{
if($password!=$cpassword)
{
header('Location: http://localhost/Practice/php/proj/#toregister?errorp=1');
}
else
{
echo "Password Correct";
}
}
?>