-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangedept.php
More file actions
36 lines (35 loc) · 764 Bytes
/
Copy pathchangedept.php
File metadata and controls
36 lines (35 loc) · 764 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
<html>
<head>
</head>
<?php
if(isset($_POST['submit']))
{
session_start();
include "db.php";
$a=trim($_POST["trainno"]);
$b=trim($_POST["old_departuretime"]);
$c=trim($_POST["new_departuretime"]);
$res1=mysqli_query($conn,"select * from trainform where departuretime='$b' and trainno='$a'");
if($res1->num_rows==1)
{
$res=mysqli_query($conn,"UPDATE trainform SET departuretime='$c' WHERE trainno='$a'");
if($res)
{
include "displaytrain.php";
}
else
{
echo "no such train has been entered";
}
}
else{
echo "<script type='text/javascript'>alert('no such train');</script>";
include "dept.php";
}
}
else
echo "<script type='text/javascript'>window.top.location.href='unauthorised.php';</script>";
?>
<body>
</body>
</html>