PHP Tutorial – $_REQUEST Function
In previous tutorials we already looked at the PHP built-in $_GET function and $_POST function. In this tutorial we take a quick look at the PHP built-in $_REQUEST function.
The PHP built-in $_REQUEST function can be used with both the GET and POST methods.
Let’s take a look at an $_REQUEST function example:
<html>
<body>
<form action="test.php" method="post">
Your name: <input type="text" name="yourname" />
<input type="submit" />
</form>
</body>
</html>
In the test.php script we can do the following (note: that we have use the POST method in the form):
Welcome <?php echo $_REQUEST ["yourname"]; ?>!
That’s all for this tutorial. (We said it would be a quick look
)
This entry was posted in PHP Tutorials.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Tweet This! or use
to share this post with others.