-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocupdateback.php
More file actions
47 lines (42 loc) · 1.14 KB
/
docupdateback.php
File metadata and controls
47 lines (42 loc) · 1.14 KB
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
<?php
session_start();
include "db_conn.php";
if (isset($_POST['dname']) && isset($_POST['patlimit'])) {
function validate($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$dname = validate($_POST['dname']);
$patlimit = validate($_POST['patlimit']);
if(empty($dname)){
header("Location: docupdate.php?error=doctor name is required");
exit();
}
else if(empty($patlimit)){
header("Location: docupdate.php?error=patiend check limit is required");
exit();
}
else{
$sql = "Update doctorlist set patlimit = '$patlimit' WHERE name='$dname'";
//$sql = "INSERT INTO users (user_name, password) VALUES ('$uname','$pass') ";
//echo phpinfo();
$result = mysqli_query($conn, $sql);
header("Location: viewappointmentspat.php");
exit();
/*if (mysqli_num_rows($result) === 1)
{
header("Location: viewappointmentspat.php");
exit();
}
else{
header("Location: docupdate.php?error=problem");
exit();
}*/
}
}
else{
header("Location: docupdate.php?error=credentials empty");
exit();
}