Learning & Integrating web technology and code help directory

How to use PHP & Multiple Hidden Field

No comments
How to use PHP &  Multiple Hidden Field This tutorial how to using PHP read a variable from input Multiple Hidden Field
ShotDev Focus:
- Using PHP & Multiple Hidden Field
Example
php_multiple_hidden1.php
  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <form action="php_multiple_hidden2.php" method="post" name="form1">  
  7. <input type="hidden" name="hdnSiteName[]" value="ShotDev.Com">  
  8. <input type="hidden" name="hdnSiteName[]" value="Hotmail.Com">  
  9. <input type="hidden" name="hdnSiteName[]" value="Google.Com">  
  10. <input name="btnSubmit" type="submit" value="Submit">  
  11. </form>  
  12. </body>  
  13. </html>  
php_multiple_hidden2.php

  1. <html>  
  2. <head>  
  3. <title>ShotDev.Com Tutorial</title>  
  4. </head>  
  5. <body>  
  6. <?  
  7. for($i=0;$i<count($_POST["hdnSiteName"]);$i++)  
  8. {  
  9. echo "hdnSiteName $i = ".$_POST["hdnSiteName"][$i]."<br>";  
  10. }  
  11. ?>  
  12. </body>  
  13. </html>  
Create a php file and save to path root-path/myphp/
Screenshot
PHP Hidden
PHP Multiple Hidden
.
.
.


No comments :

Post a Comment