-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScode.php
37 lines (31 loc) · 1.12 KB
/
Scode.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
<?php
session_start();
require 'dbcon.php';
?>
<?php
if(isset($_POST['update_student']))
{
$userID = $_SESSION['email'];
$FirstName = mysqli_real_escape_string($con, $_POST['FirstName']);
$LastName = mysqli_real_escape_string($con, $_POST['LastName']);
$DateOfBirth = mysqli_real_escape_string($con, $_POST['DateOfBirth']);
$Gender = mysqli_real_escape_string($con, $_POST['Gender']);
$Phone = mysqli_real_escape_string($con, $_POST['Phone']);
$Email = mysqli_real_escape_string($con, $_POST['Email']);
$Password = mysqli_real_escape_string($con, $_POST['Password']);
$query = "UPDATE student SET FirstName='$FirstName', LastName='$LastName', DateOfBirth='$DateOfBirth',Gender='$Gender',Phone='$Phone', Email='$Email', Password='$Password' WHERE email='$userID' ";
$query_run = mysqli_query($con, $query);
if($query_run)
{
$_SESSION['message'] = "Student Updated Successfully";
header("Location: Sprofile.php");
exit(0);
}
else
{
$_SESSION['message'] = "Student Not Updated";
header("Location: Sprofile.php");
exit(0);
}
}
?>