session handling question
Posted: Thu May 30, 2002 11:22 pm
Hi all,
I have been asking this question over and over everywhere (other sites) and got no response so i was hoping someone from this forum can help me. Thanks in advance.
Here is my problem:
I have a 'change password' script,
Everytime when I change a password, it will give me an error message due to session register. To fix this, i will have to use unregister_session or destroy_session, here comes my problem,
I have something like this:
and I inserted it into the script:
It still didnt work, I still get error message after changing password. Could you tell me what went wrong, what did i miss, what did i do wrong?
Thank you very much
I have been asking this question over and over everywhere (other sites) and got no response so i was hoping someone from this forum can help me. Thanks in advance.
Here is my problem:
I have a 'change password' script,
Code: Select all
....
//CHANGE PASSWORD
if ($changepassword != "")
{
print "Your old password has been deleted...";
$query = "UPDATE job SET username = $username, password = $password WHERE clientid='$currentuser'";
if (!mysql_query ($query, $link) )
{
die (mysql_error());
}
print "Your new password is $password</b></font>";
print "</td></tr></table>";
Print "</td></tr></table><br><br>";
}
$result = mysql_query("SELECT * FROM job WHERE clientid='$currentuser';",$link);
while ($a_row =mysql_fetch_array ($result) )
{
print "<form name="cp" action="./changepassword.php?changepassword=$a_rowїclientid]&edit=$currentuser" method=post>";
print "User Name:$a_rowїusername]";
print "Password:<input type="text" name="password" value="$a_rowїpassword]">";
print "<input type=submit Value='Change Now'></form></center>";
}I have something like this:
Code: Select all
session_unregister("password");
$password=$newpassword;
session_register("password");Code: Select all
//CHANGE PASSWORD
if ($changepassword != "")
{
print "Your old password has been deleted...";
$query = "UPDATE job SET username = $username, password = $password WHERE clientid='$currentuser'";
if (!mysql_query ($query, $link) )
{
die (mysql_error());
}
session_unregister("password");
$password=$newpassword;
session_register("password");
print "Your new password is $password</b></font>";
print "</td></tr></table>";
Print "</td></tr></table><br><br>";
}
$result = mysql_query("SELECT * FROM job WHERE clientid='$currentuser';",$link);
while ($a_row =mysql_fetch_array ($result) )
{
print "<form name="cp" action="./changepassword.php?changepassword=$a_rowїclientid]&edit=$currentuser" method=post>";
print "User Name:$a_rowїusername]";
print "Password:<input type="text" name="password" value="$a_rowїpassword]">";
print "<input type=submit Value='Change Now'></form></center>";
}Thank you very much