-
Notifications
You must be signed in to change notification settings - Fork 0
/
registerForm.php
35 lines (29 loc) · 1.02 KB
/
registerForm.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
<?php
/**
* Created by PhpStorm.
* User: alihamza
* Date: 5/19/18
* Time: 1:55 PM
*/
session_start();
include_once ("connection.php");
if($_POST['rollNo']) {
$rollNo = $_POST['rollNo'];
$queryForCheck = "select firstName from userInfo where lower(rollNo)=" . $rollNo;
$res = mysqli_query($conn, $queryForCheck);
if (!$res) {
$firstName = $_POST['firstName'];
$lastName = $_POST['lastName'];
$gender = $_POST['gender'];
$password = $_POST['password'];
$date = $_POST['dateOfBirth'];
$insertQuery = "insert into userInfo (firstName,lastName,rollNo,userPassword,dateOfBirth ,gender)
values ('" . $firstName . "','" . $lastName . "','" . $rollNo . "','" . $password . "','" . $date . "','" . $gender . "')";
$checkInsertQueryResult = mysqli_query($conn, $insertQuery);
$_SESSION['rollNo'] = $rollNo;
$_SESSION['firstName'] = $firstName;
$_SESSION['lastName'] = $lastName;
} else {
echo "1";
}
}