Can anyone direct me what iam doing wrong.
here is my script.
<?php
session_start();
include_once("conn.php");
//$uname=$_GET['UserName'];
$uname= $_SESSION[resetpassof];
$result = mssql_query("SELECT * FROM tblUser WHERE UserName='$uname'");
if(trim($_POST['newpass']) <> trim($_POST['newpass'])){
echo"Password not match";
}
else{
update($_POST['newpass'],$_SESSION[username],$_SESSION[resetpassof],$con);
header('Location:changepass.php');
}
function update($npass,$ChBy,$name,$con){
mssql_query("sp_uppass @newpass='$npass',UpdateBy='$ChBy',@name='$name'");
mssql_close($con);
}
?>
should it be @UpdateBy ? (I’m not sure just my reaction when I see it)
yup your right…i did not see it…Thanks…
is there a error in this query.?
<?php
session_start();
include_once("conn.php");
//$uname=$_GET['UserName'];
$uname= $_SESSION[resetpassof];
$result = mssql_query("SELECT * FROM tblUser WHERE UserName='$uname'");
//it must echo out if the if statement below is true but it does not.
if(trim($_POST['newpass'])<>trim($_POST['newpass'])){
echo"Password not match";
}
else{
update(md5($_POST['newpass']),$_SESSION[username],$_SESSION[resetpassof],$con);
//header('Location:changepass.php');
}
function update($npass,$ChBy,$name,$con){
mssql_query("sp_uppass @newpass='$npass',@UpdateBy='$ChBy',@name='$name'");
mssql_close($con);
}
?>