PHP Redirect and maintain Request Parameters - Advice Needed
Posted: Sat Nov 28, 2009 12:09 pm
Hey All.
Somewhat new to php, so excuse the simple question.
Currently, I have a 'register_game.php' that takes form data and submits via get method to a tfmail script. All this is working fine.
I need to add in some validation to check that user data on the form is valid existing user. So, I have added a 'check_user.php' that hits the database, and checks that the user exists. This is working fine as well. What I'm having trouble with is after the check...
So, what I have now is:
The 'register_game.php' page that takes form data and submits to a 'check_name.php' page.
'check_name.php' then validates information and will either:
- continue on and redirect to 'tfmail' script
- return user back to 'register_game.php
The problem I'm having is redirecting to tfmail script or back to the 'register_game.php'. The REQUEST attributes are no longer in the request. What is the best way to "re-insert" the request data so that when I redirect with a header( 'Location:xxx) function from the 'check_name.php' to the other pages, the data from the form submitted by the original submit in the 'register_game.php' will continue on to the pages I redirect to.
Hope this makes sense. Any input or advice would be appreciated.
Somewhat new to php, so excuse the simple question.
Currently, I have a 'register_game.php' that takes form data and submits via get method to a tfmail script. All this is working fine.
I need to add in some validation to check that user data on the form is valid existing user. So, I have added a 'check_user.php' that hits the database, and checks that the user exists. This is working fine as well. What I'm having trouble with is after the check...
So, what I have now is:
The 'register_game.php' page that takes form data and submits to a 'check_name.php' page.
'check_name.php' then validates information and will either:
- continue on and redirect to 'tfmail' script
- return user back to 'register_game.php
The problem I'm having is redirecting to tfmail script or back to the 'register_game.php'. The REQUEST attributes are no longer in the request. What is the best way to "re-insert" the request data so that when I redirect with a header( 'Location:xxx) function from the 'check_name.php' to the other pages, the data from the form submitted by the original submit in the 'register_game.php' will continue on to the pages I redirect to.
Hope this makes sense. Any input or advice would be appreciated.