web 2.0

How to use PHP & Multiple Hidden Field

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/

Run
http://localhost/myphp/php_multiple_hidden1.php

Screenshot

PHP Hidden

PHP Multiple Hidden
.
.
.

Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.