开发者

header() function : a small curiosity

开发者 https://www.devze.com 2023-02-26 08:15 出处:网络
As for the PRG model, on my web application I process data on the server and than I do a redirect by using header(\'Location: misc/page_done.php&message=1\');

As for the PRG model, on my web application I process data on the server and than I do a redirect by using header('Location: misc/page_done.php&message=1');

For manage the output, on my page_done.php I've a sort of select case when, due to the message variable value (1,2,3, and so on), I'll print the right output message to the user.

This by using GET to pass the variables to the redirected page. Could I pass this variables (in my example, the string message) trought POST instead of开发者_开发技巧 GET? Yeah, looks stupid, but just for curiosity...


No. Redirects forced in this manner can never result in a POST. Put the variable in a session if you don't want to show it in the URL.


The simple answer is no. Using header Location you can't pass things through post, only get.

0

精彩评论

暂无评论...
验证码 换一张
取 消