What the difference with POST and REQUEST? Does it recommend if I plan to submit the whole form without the need to write parameters?
link.php?param=1¶m=2¶m=3
Mark Biek
152k54 gold badges160 silver badges201 bronze badges
-
I do not understand what you are talking about. Do you mean the difference between POST and GET? I still don't understand the 2nd part of your question thoughPekka– Pekka2010年10月09日 19:56:56 +00:00Commented Oct 9, 2010 at 19:56
-
Nevermind, learn for others then.proyb3– proyb32010年10月09日 20:01:03 +00:00Commented Oct 9, 2010 at 20:01
2 Answers 2
$_REQUEST includes $_COOKIE, $_GET and $_POST.
If you know the type of your request, you are best to use $_GET or $_POST.
answered Oct 9, 2010 at 19:56
Gazler
84.4k18 gold badges285 silver badges245 bronze badges
Sign up to request clarification or add additional context in comments.
3 Comments
proyb3
so if I POST from index.php to be submit to link.php, how can I get the params to retain in url address with link.php?
Gazler
You do a submit your form as a GET to pass the variables through the querystring.
netrox
if you want the form to add values in the URL, you use "<form method="GET" action="blah">
$_POST contains POST data, while $_REQUEST contains POST, query string and cookie data.
Use the specific superglobal as that way you only get data from where you expect.
answered Oct 9, 2010 at 19:57
Quentin
949k137 gold badges1.3k silver badges1.4k bronze badges
3 Comments
proyb3
so if I POST from index.php to be submit to link.php, how can I get the params to retain in url address with link.php?
Quentin
If you want to pass the data to the handler for the POST request, make them hidden inputs. If you want to make the result of the POST request bookmarkable / linkable, follow the POST-Redirect-GET pattern: en.wikipedia.org/wiki/Post/Redirect/Get
Omar Al-Ithawi
@proyb3: I guess you should change the
<form method="post"> to <form method="get"> is that what you want?default