|
|
|
<html>
<body>
<form method=post >
<select name=choices[] multiple>
<option>uno
<option>due
<option>tre
<option>quattro
<option>cinque
</select>
<input type=submit value=Ok>
<hr>
<?php
$lastInsert=$HTTP_POST_VARS[choices];
if ($lastInsert) {
$n0=count($stack);
for ($i=0;$i<$n0;$i++) {
echo "<input type=hidden name=\"stack[]\" value=\"$stack
[$i]\" >";
}
$n1=count($lastInsert);
for ($i=0;$i<$n1;$i++) {
echo "<input type=hidden name=\"stack[]\" value=
\"$lastInsert[$i]\" >";
}
/*Uncomment this to see temporary values: only for debugging purpouses.
for($i=0;$i<$n0;$i++) {
echo "<h2>STACK:</h2> $stack[$i]<br>";
}
for($i=0;$i<$n1;$i++) {
$value=$lastInsert[$i];
echo "<h2>lastInsert:</h2> $value<br>";
}
*/
}
?>
<?php
$stack=$HTTP_POST_VARS[stack];
$n=count($stack);
for($i=0;$i<$n;$i++) {
echo "$i) ".$stack[$i]."<br>";
}
$ultimi=$HTTP_POST_VARS[choices];
$n=count($ultimi);
for($i=0;$i<$n;$i++) {
echo "-> ".$ultimi[$i]."<br>";
}
?>
</form>
</body>
</html>
|
|
| Make old style (PHP3) scripts using GET, POST, COOKIE and File uploads (POST) compatible with
PHP 4.2.0 Categories : PHP, HTML and PHP, Global Variables, Cookies, Variables | | | Select with current month Categories : PHP, HTML and PHP, Date Time, Arrays | | | Dump the contents of a PHP variable in html format with a recursive list of subfolders and files from a given root directory.
Categories : PHP, Directories, Variables, Arrays | | | translate.php - Assocciative array example, passing a reference to a function. Categories : PHP, Arrays, Languages, Variables | | | getting the name of the current script and query string Categories : PHP, Global Variables, Variables, URLs | | | Tag content retrieval from websites with preg_match Categories : PHP, Regexps, Arrays, HTML and PHP | | | clearing variables in php3 Categories : Variables, Arrays, PHP | | | Check parameters validity. Paranoia was designed to check the validity of the parameters that a php page will receive after a form submission. It can be used to check the variables sent by POST or GET Categories : Algorithms, HTML and PHP, PHP, Variables | | | dynamic table columns Categories : PHP, HTML and PHP, Arrays, Databases, MySQL | | | How to pass an array from one PHP Script to another via an HTML form Categories : PHP, HTML and PHP, Arrays | | | Print out array key => value in colored HTML Categories : PHP, Arrays, HTML and PHP | | | Form Submission Using Array's Categories : PHP, HTML and PHP, Beginner Guides, Arrays | | | A quick way set data from a form to a function or other places where you can lose scope. Categories : PHP, HTML and PHP, Variables | | | Parsing html tags with php. Get an array from this function Categories : PHP, HTML and PHP, Arrays, Tag Extractors | | | Pageinfo: Array containing page URI, page query string (parameters), request method (GET or POST) and the complete URI Categories : Variables, PHP Options and Info, Arrays, URLs, PHP | |
|
|
|