forms - Is post data persistent through php header redirect? -
If I submit a form to a php page using the post, should I include those post values on that page Can I use the header ('location: ... php') to be redirected to
redirect?
Example:
& lt; Form action = "welcome.php" method = "post" & gt; Name: & lt; Input type = "text" name = "name" & gt; & Lt; Br> E-mail: & lt; Input type = "text" name = "email" & gt; & Lt; Br> & Lt; Input type = "submit" & gt; & Lt; / Form & gt;
At welcome.php, if I do the header ("location: welcomback.php")
still do I $ _ POST ['name '] Can I use?
and $ _ POST ['e-mail']
... ( welcomeback.php
)?
not , you can not redirect to another page being redirected to another page Means and no $ _ POST
value will not be available in the $ _ POST
array. On the other hand you can still throw links to prices and are available in other pages. For example
header ('location: other .php? Data = one');
You can use it in another page
$ _GET ['data'] echo; // print one
As I add, you can redirect to another page with a form verb, and then all the code will be $ _ POST
Array
Comments
Post a Comment