How to retrieve form data?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The first execution of the file below produces the expected output:
Request Method: GET

Clicking on the Submit button outputs:
Request Method: POST
$_POST array contains:
Array

Why don't I see one of the values from the select item?
----------------------------------------------------------------------------
---------------
<html>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" >
   <select name="item" >
     <option value="select item 1" > item 1 </option>
     <option value="select item 2" > item 2 </option>
   </select>
<input type=submit value="Submit">
</form>

<?php
echo "Request Method: ".$_SERVER['REQUEST_METHOD']."<br />";

if ($_SERVER['REQUEST_METHOD'] == "POST"):
   echo '$_POST array contains:'."<br />";
   foreach ($_POST as $value) {echo $value."<br />";}
endif;
?></html>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux