PHP $_REQUEST
No Comments Yet so far
Leave a comment
March 4, 2008, 12:52 am
Filed under: PHP
Filed under: PHP
PHP $_REQUEST
This variable contains the content of both $_GET, $_COOKIE, and $_POST.
This can get the values passed from the form with both the GET and POST methods.
Here are 2 examples:
<form action=”myphp.php” method=”POST”>
Firstname: <input type=”text” name=”firstname” />
Lastname: <input type=”text” name=”lastname” />
<input type=”submit” />
</form>
<?php
echo “Firstname: “ $_REQUEST[“firstname”]; . <br />;
echo “Lastname: “ $_REQUEST[“lastname”];
?>
OR
<form action=”myphp.php” method=”GET”>
Firstname: <input type=”text” name=”firstname” />
Lastname: <input type=”text” name=”lastname” />
<input type=”submit” />
</form>
<?php
echo “Firstname: “ . $_REQUEST[“firstname”] . “<br />”;
echo “Lastname: “ . $_REQUEST[“lastname”] ;
?>
Leave a Comment
No Comments Yet so far
Leave a comment
Leave a comment
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>