forked from devashishg/git1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathredirect.php
More file actions
27 lines (25 loc) · 936 Bytes
/
redirect.php
File metadata and controls
27 lines (25 loc) · 936 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
<?php
session_start();
?>
<?php
echo "redirecting to data page............";
$a=0;
$connect = mysqli_connect("localhost","root","","erp") or Die("Not Connected");
$command = "SELECT id FROM Student_Record";
$query = mysqli_query($connect,$command) or die(mysqli_error($query));
//echo mysqli_num_rows($query);
if(mysqli_num_rows($query) > 0){
while($row = mysqli_fetch_assoc($query)) {
//if((strcmp($usr,$row["id"]))==0 and (strcmp($pas,$row["Password"])==0)) {
$usr = $row["id"];
$usr1=$_POST["$usr"];
if($usr1=="Reject"){
$command = "INSERT INTO rejected_student select * from Student_Record where id=$usr";
$query = mysqli_query($connect,$command) or die(mysqli_error($query));
$command = "DELETE FROM Student_Record WHERE Student_Record.id = $usr";
$query = mysqli_query($connect,$command) or die(mysqli_error($query));
}
}
}
header('Location:index.html');
?>