Page 1 of 1

php sessions problem..

Posted: Sat Mar 28, 2009 2:27 pm
by pavanpuligandla
hii..
i've a form which takes userid as input and validates it with the DB then shows a form with four fields and if they were also entered correctly it shows success message.. else error..
my problem is :
when i enter an userID say "jaoude" which exists in DB, then i can see the from fields page, there if i enter another user's say "pavan"'s details correctly then it is showing me success message,,
i've to match only user's "jaoude"'s detaisl with the DB not others..
here's my first page's query where i'm matching userID with DB:

Code: Select all

$query="SELECT customerID, Login FROM ss_customers WHERE Login='" . mysql_real_escape_string($Login) . "'";
my second page's validation code:

Code: Select all

$query="SELECT first_name, last_name, state, zip  FROM ss_customer_addresses WHERE customerID='" . mysql_real_escape_string($customerID) . "'";

Re: php sessions problem..

Posted: Sun Mar 29, 2009 2:49 am
by pavanpuligandla
any help please..

Re: php sessions problem..

Posted: Sun Mar 29, 2009 4:51 am
by requinix
pavanpuligandla wrote:i've to match only user's "jaoude"'s detaisl with the DB not others
Can you rephrase that?

Re: php sessions problem..

Posted: Sun Mar 29, 2009 11:11 am
by pavanpuligandla
hii..
thanks for the come back..

i'll clearly explain you my scenario..
i need mail.yahoo.com site like password recovery functionality.
for that to achieve, i created 4 forms,
step 1 : takes userID as input and validates it with the DB, if userID found then show him step2 else repeat step1.
step2: show the same user form fields like (firstname, lastname, security question, country which he entered during the registration) if he enters the correct data then send a link to his email when clicked takes him to the password update page.. else repeat step2 only.

i achieved first 2 steps in the above scenario..
but there is a problem..
suppose in the first step say user "A" has entered his userID and sent to the second page, there if he enters his information correctly then success..
but in my case, when user A inputs his userID and gets validated then he'll be moved to the second form, there if i enter other user's details correctly(whicch were already in the DB) it is showing me success page..which it should throw an error instead.

if you want my 4 forms code, i'll paste it..
i hope you understood my problem..
i think there is a query error in my script.. please let me know your ideas so that i can paste all my 4 forms
many thanks.. :(

Re: php sessions problem..

Posted: Sun Mar 29, 2009 12:30 pm
by tech603
This link could help.

http://www.plus2net.com/php_tutorial/ph ... ssword.php

Hope that helps.

Re: php sessions problem..

Posted: Sun Mar 29, 2009 10:58 pm
by pavanpuligandla
hii ..
This link could help.

http://www.plus2net.com/php_tutorial/ph ... ssword.php

Hope that helps.
yes surely, but i dont need those scripts, i want yahoo mail or ebay.in site like password reset feature.i'm having some sessions problem in my forms..please let me know if you can help me in that issue..
thanks.