i have a code in php that changes password. it runs smoothly no errors, but the question is it does not update the passoord on the database??
here is the form $s is the session ID
here is the script that updates
i have tried anything and still to no avail please help thank you
here is the form $s is the session ID
Code:
<?php echo" <form action = \"chpw.php?d='$s'\" method = 'POST'> NEW PASSWORD: <input type='text' name='pass'> <br/> <input type='submit' value='Submit Password'><br/> </form>"; ?>
here is the script that updates
Code:
<?php
//$password = md5($_POST['pass']);
//$s=$_GET['d'];
//$s=$_POST['id'];
if(md5($_POST['pass'])== ''){
echo ('invalid password');
}else
$sql="UPDATE account SET Password='".md5($_POST['pass'])."' WHERE StudId='".$_GET['d']."'";
$result=mysql_query($sql);
if (!$result)
die('Error: ' . mysql_error());
echo "Password Changed Successfully!<br><br>\n";
header('location: pwlogout.php');
exit();
?>
Comment