-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathregistrationHandler.php
More file actions
42 lines (28 loc) · 1017 Bytes
/
registrationHandler.php
File metadata and controls
42 lines (28 loc) · 1017 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
32
33
34
35
36
37
38
39
40
41
42
<?php
include_once( "queryFunctions.php" );
if ( isset( $_POST[ "submit" ] ) ) {
$loginUser = $_POST[ "formname" ];
$loginPass1 = $_POST[ "formpassword" ];
$loginPass2 = $_POST[ "formcnfpassword" ];
if ( checkUserExist( $_POST[ "formname" ] ) ) {
header( "Location: registration.php?status=UserNameAlreadyExist" );
} else {
$returnValue = addNewUser( $_POST[ "formname" ], $_POST[ "formpassword" ], $_POST[ "formcnfpassword" ], "standard" );
//var_dump($returnValue);
if ( $returnValue > 0 ) {
session_start();
$_SESSION[ "userid" ] = $returnValue;
header( "Location: userindex.php" );
} else {
if ($returnValue == -1)
header( "Location: registration.php?status=Input_Cannot_be_Blank" );
elseif ($returnValue == -2)
header( "Location: registration.php?status=Invalid_Email_Address" );
elseif ($returnValue == -3)
header( "Location: registration.php?status=Password_Mismatch" );
else
header( "Location: registration.php?status=WrongData" );
}
}
}
?>