怎么不能正常显示呀,你是对这个函数没有调用呀,当然没有反应了呀,对了你看看下面这个就是你的代码在我的机了上输出fibona的,我只加上php标志而已。不知道楼主的主要问题是什么。<?
function fenlei(){
global $prefix,$dbi,$r,$m,$s,$mtype,$stype;$rsel;
$count;
?>
<script language = "JavaScript">var onecount1;
onecount1=0;
rootcat = new Array();
<?php
$count=0;
$rsel="select distinct r,mtype,m from ".$prefix."_type order by m asc";
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
?>
rootcat[<?php echo $count ?>] = new Array("<?php echo "document.write('trim($row[r])')"?>","<?php echo trim($row[mtype])?>","<?php echo trim($row[m])?>");
<?php
$count++;
}
?>
onecount1=<?php echo $count?>;var onecount2;
onecount2=0;
subcat = new Array();
<?php
$count = 0;
$rsel="select distinct m,stype,s from ".$prefix."_type order by s asc";
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
?>
subcat[<?php echo $count ?>] = new Array("<?php echo trim($row[m])?>","<?php echo trim($row[stype])?>","<?php echo trim($row[s])?>");
<?php
$count++;
}
?>
onecount2=<?php echo $count?>;
function changem(locationid)
{
document.txForm.m.length = 0; var locationid=locationid;
var i;
for (i=0;i < onecount1; i++)
{
if (rootcat[i][0] == locationid)
{
document.txForm.m.options[document.txForm.m.length] = new Option(rootcat[i][1], rootcat[i][2]);
}
}
}function changes(locationid)
{
document.txForm.s.length = 0; var locationid=locationid;
var i;
for (i=0;i < onecount2; i++)
{
if (subcat[i][0] == locationid)
{
document.txForm.s.options[document.txForm.s.length] = new Option(subcat[i][1], subcat[i][2]);
}
}
}
</script>
<?
$selo;
$rsel="select distinct r,rtype from ".$prefix."_type order by r asc";
$result=mysql_query($rsel,$dbi);
if(!$row=mysql_fetch_array($result)){
echo "请先添加栏目。";
}
else{
echo "<select name='r' onChange='changem(document.txForm.r.options[document.txForm.r.selectedIndex].value)'>";
unset($result);
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
if($row[r]==$r){
$selo="selected";
}
else{
$selo="";
}
echo "<option ".$selo." value='".trim($row[r])."'>".trim($row[rtype])."</option>";
}
}
echo "</select>";
echo "<select name='m' onChange='changes(document.txForm.m.options[document.txForm.m.selectedIndex].value)'>";
if($mtype<>""){
echo "<option selected value=".$m.">".$mtype."</option>";
}
else{
echo "<option selected value=>请选栏目</option>";
}
echo "</select>";
echo "<select name='s'>";
if($stype<>""){
echo "<option selected value=".$s.">".$stype."</option>";
}
else{
echo "<option selected value=>请选栏目</option>";
}
echo "</select><font color=red>**</font>";} //function end
?>
asdgasdgjkl;asdgklj;
function fenlei(){
global $prefix,$dbi,$r,$m,$s,$mtype,$stype;$rsel;
$count;
?>
<script language = "JavaScript">var onecount1;
onecount1=0;
rootcat = new Array();
<?php
$count=0;
$rsel="select distinct r,mtype,m from ".$prefix."_type order by m asc";
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
?>
rootcat[<?php echo $count ?>] = new Array("<?php echo "document.write('trim($row[r])')"?>","<?php echo trim($row[mtype])?>","<?php echo trim($row[m])?>");
<?php
$count++;
}
?>
onecount1=<?php echo $count?>;var onecount2;
onecount2=0;
subcat = new Array();
<?php
$count = 0;
$rsel="select distinct m,stype,s from ".$prefix."_type order by s asc";
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
?>
subcat[<?php echo $count ?>] = new Array("<?php echo trim($row[m])?>","<?php echo trim($row[stype])?>","<?php echo trim($row[s])?>");
<?php
$count++;
}
?>
onecount2=<?php echo $count?>;
function changem(locationid)
{
document.txForm.m.length = 0; var locationid=locationid;
var i;
for (i=0;i < onecount1; i++)
{
if (rootcat[i][0] == locationid)
{
document.txForm.m.options[document.txForm.m.length] = new Option(rootcat[i][1], rootcat[i][2]);
}
}
}function changes(locationid)
{
document.txForm.s.length = 0; var locationid=locationid;
var i;
for (i=0;i < onecount2; i++)
{
if (subcat[i][0] == locationid)
{
document.txForm.s.options[document.txForm.s.length] = new Option(subcat[i][1], subcat[i][2]);
}
}
}
</script>
<?
$selo;
$rsel="select distinct r,rtype from ".$prefix."_type order by r asc";
$result=mysql_query($rsel,$dbi);
if(!$row=mysql_fetch_array($result)){
echo "请先添加栏目。";
}
else{
echo "<select name='r' onChange='changem(document.txForm.r.options[document.txForm.r.selectedIndex].value)'>";
unset($result);
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
if($row[r]==$r){
$selo="selected";
}
else{
$selo="";
}
echo "<option ".$selo." value='".trim($row[r])."'>".trim($row[rtype])."</option>";
}
}
echo "</select>";
echo "<select name='m' onChange='changes(document.txForm.m.options[document.txForm.m.selectedIndex].value)'>";
if($mtype<>""){
echo "<option selected value=".$m.">".$mtype."</option>";
}
else{
echo "<option selected value=>请选栏目</option>";
}
echo "</select>";
echo "<select name='s'>";
if($stype<>""){
echo "<option selected value=".$s.">".$stype."</option>";
}
else{
echo "<option selected value=>请选栏目</option>";
}
echo "</select><font color=red>**</font>";} //function end
?>
asdgasdgjkl;asdgklj;
function fenlei(){
global $prefix,$dbi,$r,$m,$s,$mtype,$stype;$rsel;
$count;
?>
<script language = "JavaScript">var onecount1;
onecount1=0;
rootcat = new Array();
<?php
$count=0;
$rsel="select distinct r,mtype,m from ".$prefix."_type order by m asc";
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
?>
rootcat[<?php echo $count ?>] = new Array("<?php echo "document.write('trim($row[r])')"?>","<?php echo trim($row[mtype])?>","<?php echo trim($row[m])?>");
<?php
$count++;
}
?>
onecount1=<?php echo $count?>;var onecount2;
onecount2=0;
subcat = new Array();
<?php
$count = 0;
$rsel="select distinct m,stype,s from ".$prefix."_type order by s asc";
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
?>
subcat[<?php echo $count ?>] = new Array("<?php echo trim($row[m])?>","<?php echo trim($row[stype])?>","<?php echo trim($row[s])?>");
<?php
$count++;
}
?>
onecount2=<?php echo $count?>;
function changem(locationid)
{
document.txForm.m.length = 0; var locationid=locationid;
var i;
for (i=0;i < onecount1; i++)
{
if (rootcat[i][0] == locationid)
{
document.txForm.m.options[document.txForm.m.length] = new Option(rootcat[i][1], rootcat[i][2]);
}
}
}function changes(locationid)
{
document.txForm.s.length = 0; var locationid=locationid;
var i;
for (i=0;i < onecount2; i++)
{
if (subcat[i][0] == locationid)
{
document.txForm.s.options[document.txForm.s.length] = new Option(subcat[i][1], subcat[i][2]);
}
}
}
</script>
<?
$selo;
$rsel="select distinct r,rtype from ".$prefix."_type order by r asc";
$result=mysql_query($rsel,$dbi);
if(!$row=mysql_fetch_array($result)){
echo "请先添加栏目。";
}
else{
echo "<select name='r' onChange='changem(document.txForm.r.options[document.txForm.r.selectedIndex].value)'>";
unset($result);
$result=mysql_query($rsel,$dbi);
while($row=mysql_fetch_array($result)){
if($row[r]==$r){
$selo="selected";
}
else{
$selo="";
}
echo "<option ".$selo." value='".trim($row[r])."'>".trim($row[rtype])."</option>";
}
}
echo "</select>";
echo "<select name='m' onChange='changes(document.txForm.m.options[document.txForm.m.selectedIndex].value)'>";
if($mtype<>""){
echo "<option selected value=".$m.">".$mtype."</option>";
}
else{
echo "<option selected value=>请选栏目</option>";
}
echo "</select>";
echo "<select name='s'>";
if($stype<>""){
echo "<option selected value=".$s.">".$stype."</option>";
}
else{
echo "<option selected value=>请选栏目</option>";
}
echo "</select><font color=red>**</font>";} //function end
?>
fibona
global $prefix,$dbi,$r,$m,$s,$mtype,$stype;$rsel;
$count;?>
这是什么意思》???