Check that user details are correct
Posted: Sun Jun 17, 2007 4:34 pm
I have a cancel membership section which is only available to users who are logged in.
In order to cancel your membership, users must fill in the form which consists of their username and password.
This then checks the username and password that they entered in the form against the session variables username and password (username and password of the person logged in). It seems to work fine if the username and password are the exact same but if they are different it doesn't work
e.g i've set up two accounts using the details below
username: peter password: peter works fine
username: john password: simon doesn't work
So i have:
PHP Code:
Here is the code i have:
PHP Code:
Can anyone see why this is not working
In order to cancel your membership, users must fill in the form which consists of their username and password.
This then checks the username and password that they entered in the form against the session variables username and password (username and password of the person logged in). It seems to work fine if the username and password are the exact same but if they are different it doesn't work
e.g i've set up two accounts using the details below
username: peter password: peter works fine
username: john password: simon doesn't work
So i have:
PHP Code:
Code: Select all
$username = $_POST['username']; // gets username from the form
$password = $_POST['password']; // gets username from the form
$susername = $_SESSION['my_array'][0]; // username of person logged in
$spassword = $_SESSION['my_array'][10]; // password of person logged inPHP Code:
Code: Select all
if ($username == $susername & $password == $spassword)
{