Skip to main content
gamedev.net
🔒 Locked 🤖 Godot

[web] [PHP] Pass $_REQUEST through header('location:...')?

Started by BeanDog 3 replies 1.2k views
Original Post
BeanDog
BeanDog
I have one page that takes some user input. Its form submits to itself. The page processes the input. If the input was invalid, it displays error message(s) and the original form. If the input was valid, it does some processing and then does a header('location: ...') to go on to the next step. The problem is, the second page needs the content of the HTTP request ($_REQUEST) from the first page, and I'd like to not pass the information through a querystring in the URL (the information is somewhat sensitive). Is there a clean way to simply pass the $_REQUEST on to the next page?
Terlenth
Terlenth
If it's through the URL string, you would use $_GET. You would have to change your form to use the GET type though.
--Ter'Lenth
konForce
konForce
Quote:
Is there a clean way to simply pass the $_REQUEST on to the next page?

You should just set a session variable. This is what they are for.
BeanDog
BeanDog
I know, I should set session variables, but it's like 15 variables :-p I guess that's what I need to do, though.
konForce
konForce
The lazy route:

$_SESSION['LOGIN_REQUEST'] = $_REQUEST;

Although generally it is better to parse through it and only store what you need.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.