0

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&param=2&param=3 
2
  • 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 though Commented Oct 9, 2010 at 19:56
  • Nevermind, learn for others then. Commented Oct 9, 2010 at 20:01

2 Answers 2

4

$_REQUEST includes $_COOKIE, $_GET and $_POST.

If you know the type of your request, you are best to use $_GET or $_POST.

Sign up to request clarification or add additional context in comments.

3 Comments

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?
You do a submit your form as a GET to pass the variables through the querystring.
if you want the form to add values in the URL, you use "<form method="GET" action="blah">
1

$_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.

3 Comments

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?
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
@proyb3: I guess you should change the <form method="post"> to <form method="get"> is that what you want?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.