My redirect page specified in my Update Record is overlooked....

Firstly, sorry about the mingy 45 points but that's all I have left...

Anway, this relates to a question I posted earlier, trying to work out how to access a specific recordset (to update it via an update page) from a database by entering an email address and password. I've managed this to an extend, through the following method;

I created a simple form with 2 text areas.

One textfield called PasswordID and the other textfield called contactID

The form action specified in the property inspector goes to Update.php


In Update.php I created a another form, and in it, textfields corresponding to the values I would want the user to be able to edit.

I then created a recordset (Bindings, +, Recordset(query).

I selected the ADVANCED recordset view and entered the following SQL

SELECT *
FROM TestTable
WHERE password = 'colname' AND contactmail = 'colnames'

Under variables I entered the following:

Name Default Value Run-time Value
colname 1 $_POST['passwordID']
colnames 1 $_POST['contactID']


Now in order to ensure that anyone who entered incorrect password and email details gets directed to another page I put in this line

if($totalRows_rsupdate<1)
header("Location: http://www.example.com/rejected.php");

just before the php code ended.

So, this worked and if the user entered the correct email and password details they would be forwarded through to my update page. However, after making the updates, and pressing the update button,  the user was then directed to :

("Location: http://www.example.com/rejected.php");     (THANKS HAVIN_IT!)

and not the page I had specified in the Update Record Set, using the UPdate Recordset behaviour

So without overwriting this functionality which sends any user to the rejected screen if they enter the wrong login details, how can I send them to the page I specified in the update recordset page after they update???

Any help, as always, would be greatly appreciated...

Thanks
AdamTrying to learn phpAsked:
Who is Participating?
 
alexhoganCommented:
You will have to re-query the database for their records.

Once they made the update then they no longer matched what was in the database.  So after the update you'll have to query the database using the logon information that you have on the individual so you can send them to the correct page.
0
 
AdamTrying to learn phpAuthor Commented:
Cheers for that and sorry about the delay.

Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.