例子:Multiple Selection
时间:2007-02-17 来源:PHP爱好者
<?PHP
function PHP_self2url(){
global $PHP_SELF;
$tmp = eregi_replace("/","/",urlencode($PHP_SELF));
return $tmp;
}
?>
<form action="<?PHP echo PHP_self2url();?>" method="post">
<p>What do you like :<select size="5" name="yourlike[]" multiple>
<option value="sports">sports</option>
<option value="pet">pet</option>
<option value="violin">violin</option>
<option value="sleep">sleep</option>
<option value="music">music</option>
<option value="eat">eat</option>
</select></p>
<input type="submit">
</form>
<?PHP
if(isset($yourlike)){
$count = count($yourlike);
echo "<h1>Your like is:<br>";
for($i=0;$i<$count;$i ){
echo " " . $yourlike[$i]."<br>";
}
}
?>
非常全面的一个php技术网站,php 爱好者站 http://www.phpfans.net 有相当丰富的文章和源代码.
function PHP_self2url(){
global $PHP_SELF;
$tmp = eregi_replace("/","/",urlencode($PHP_SELF));
return $tmp;
}
?>
<form action="<?PHP echo PHP_self2url();?>" method="post">
<p>What do you like :<select size="5" name="yourlike[]" multiple>
<option value="sports">sports</option>
<option value="pet">pet</option>
<option value="violin">violin</option>
<option value="sleep">sleep</option>
<option value="music">music</option>
<option value="eat">eat</option>
</select></p>
<input type="submit">
</form>
<?PHP
if(isset($yourlike)){
$count = count($yourlike);
echo "<h1>Your like is:<br>";
for($i=0;$i<$count;$i ){
echo " " . $yourlike[$i]."<br>";
}
}
?>
非常全面的一个php技术网站,php 爱好者站 http://www.phpfans.net 有相当丰富的文章和源代码.
相关阅读 更多 +