Learning & Integrating web technology and code help directory

How to use PHP & REQUEST Method ($_REQUEST)

No comments
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

  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <form action="php_request2.php?Version=2010" method="post" name="form1">  
  7. Name  
  8. <input name="txtName" type="text">  
  9. SiteName  
  10. <input name="txtSiteName" type="text">  
  11. <input type="submit" name="Submit" value="Submit">  
  12. </form>  
  13. </body>  
  14. </html>  
php_request2.php

  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <?php  
  7. echo $_REQUEST["txtName"]."<br>"// txtName  
  8. echo $_REQUEST["txtSiteName"]."<br>"// txtSiteName  
  9. echo $_REQUEST["Version"]."<br>"// Version  
  10. echo "<hr>";  
  11.   
  12. foreach($_REQUEST as $key => $val// All Key & Value  
  13. {  
  14. echo $key . " : " . $val . "<br>";  
  15. }  
  16. ?>  
  17. </body>  
  18. </html>  
Create a php file and save to path root-path/myphp/
Screenshot
PHP REQUEST
PHP REQUEST
.
.
.
Download this script.
Download

No comments :

Post a Comment