I'm not even sure if 'variable scope' is the right term. I basically have a form submitted that sets variables. I then redirect conditionally based on some of them, then I need to retrieve some of them again. Currently, it works if I pass them as a Query String and receive via $_GET. I'd use $_POST but it's not the very next page.
I've got a Form page, the reloaded form page which forwards to a landing page. On the landing page, its www.domain.com/landingpage?foo=bar. I'd like a better method.
on the form, i've got
if(isset($_POST['foo'])){ $foo = $_POST['foo']; } else { $foo = ''; } because I need the variables set always, even if there's an error/blank field.
Then I redirect to
http://www.domain.com/landing?foo=bar and retrieve $_GET['foo'].
On the form page, how do I set the variable for use on the latter PHP pages?