层叠菜单的动态生成
类别: PHP教程
<HTML><BODY BGCOLOR=FFFFFF>
<FORM ACTION="<?php echo $PATH_INFO?>" METHOD=POST>
<?php
if (isset($hierarchy)){
//$hierarchy[] = $selection;
if (isset($hierarchy)){
while(list($level, $sel) = each($hierarchy)){
echo "<INPUT TYPE=HIDDEN NAME=hierarchy[$level] VALUE=$sel>";
echo $level, ': ', $sel, "<BR>n";
$nextlevel = (int) $level + 1;
}
}
}
else{
$nextlevel = 0;
}
echo "<SELECT NAME=hierarchy[", $nextlevel, "]>n";
for ($I = 1; $I <= 10; $I++){
echo "<OPTION VALUE=$I>$I</OPTION>n";
}
echo "</SELECT>n";
?>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY></HTML>
<FORM ACTION="<?php echo $PATH_INFO?>" METHOD=POST>
<?php
if (isset($hierarchy)){
//$hierarchy[] = $selection;
if (isset($hierarchy)){
while(list($level, $sel) = each($hierarchy)){
echo "<INPUT TYPE=HIDDEN NAME=hierarchy[$level] VALUE=$sel>";
echo $level, ': ', $sel, "<BR>n";
$nextlevel = (int) $level + 1;
}
}
}
else{
$nextlevel = 0;
}
echo "<SELECT NAME=hierarchy[", $nextlevel, "]>n";
for ($I = 1; $I <= 10; $I++){
echo "<OPTION VALUE=$I>$I</OPTION>n";
}
echo "</SELECT>n";
?>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY></HTML>
- 上一篇: 3种平台下安装php4经验点滴
- 下一篇: 如何去掉文章里的 html 语法
-= 资 源 教 程 =-
文 章 搜 索