-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign.php
36 lines (34 loc) · 1.17 KB
/
sign.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
<?php
include_once 'dbConnection.php';
ob_start();
$name = $_POST['name'];
$name = ucwords(strtolower($name));
$gender = $_POST['gender'];
$username = $_POST['username'];
$phno = $_POST['phno'];
$password = $_POST['password'];
$branch = $_POST['branch'];
$rollno = $_POST['rollno'];
$name = stripslashes($name);
$name = addslashes($name);
$name = ucwords(strtolower($name));
$gender = stripslashes($gender);
$gender = addslashes($gender);
$username = stripslashes($username);
$username = addslashes($username);
$phno = stripslashes($phno);
$phno = addslashes($phno);
$password = stripslashes($password);
$password = addslashes($password);
$password = md5($password);
$q3 = mysqli_query($con, "INSERT INTO user VALUES (NULL,'$name', '$rollno','$branch','$gender' ,'$username' ,'$phno', '$password')");
if ($q3) {
session_start();
$_SESSION["username"] = $username;
$_SESSION["name"] = $name;
header("location:account.php?q=1");
} else {
header("location:index.php?q7=Username already exists. Please choose another&name=$name&username=$username&gender=$gender&phno=$phno&branch=$branch&rollno=$rollno");
}
ob_end_flush();
?>