How to use PHP & REQUEST Method ($_REQUEST) Learn PHP how to using REQUEST method and read a php variable from $_REQUEST method.
ShotDev Focus:
- Using PHP & $_REQUEST method.
Example
php_request1.php
<html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <form action="php_request2.php?Version=2010" method="post" name="form1"> Name <input name="txtName" type="text"> SiteName <input name="txtSiteName" type="text"> <input type="submit" name="Submit" value="Submit"> </form> </body> </html>
php_request2.php
<html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <?php echo $_REQUEST["txtName"]."<br>"; // txtName echo $_REQUEST["txtSiteName"]."<br>"; // txtSiteName echo $_REQUEST["Version"]."<br>"; // Version echo "<hr>"; foreach($_REQUEST as $key => $val) // All Key & Value { echo $key . " : " . $val . "<br>"; } ?> </body> </html>
Create a php file and save to path root-path/myphp/
Run
http://localhost/myphp/php_request1.php
Screenshot
.
.
.