-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_admin.php
48 lines (34 loc) · 988 Bytes
/
update_admin.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
38
39
40
41
42
43
44
45
46
47
48
<?php
include("dbcon.php");
//$id=$_POST['Roll'];
$name=$_POST['name'];
$email=$_POST['email'];
$emailnew=$_POST['emailnew'];
$opass=$_POST['opass'];
$pass1=$_POST['pass1'];
$pass2=$_POST['pass2'];
$result = mysql_query("SELECT * FROM admin WHERE email LIKE '$email'");
$info = mysql_fetch_array($result);
$pass =$info['pass'];
if(!$info)
{
echo("Email not valid. Please Try again.");
header( "refresh:3;url=update_admin.html" );
}
else
{
if($pass1==$pass2 && $opass==$pass)
{
$sql="UPDATE admin SET pass='$pass1', name='$name', email='$emailnew' WHERE email='$email'";
mysql_query($sql,$con);
mysql_close($con);
echo" Account Updated. Redirecting ... ";
header( "refresh:3;url=teacher.php" );
}
else
{
echo("Password Error !!! Please try Again");
header( "refresh:3;url=update_admin.html" );
}
}
?>