|

楼主 |
发表于 2002-12-9 17:47:19
|
显示全部楼层
多谢小凡!
偶上面的程序写得简单了。实际在测试中第一帖的程序是可以实现,而如果用下面的程序就无法实现了。
a.php
<?
include "b.php";
include "c.php";
if ($result)
{
select_form(1,'True');
}
else
{
select_form(1,'False');
}
?>
b.php
<?
function show_msg($msgid)
{
switch ($msgid)
{
case 0:
$msg=="Ok,please insert another one.";
break;
case 1:
$msg=="";
break;
case 2:
$msg=="";
break;
default:
$msg="none";
}
return ($msg);
}
?>
c.php
<?
function select_form($form_id,$str_form)
{
$j=$form_id;
switch ($j)
{
case 0:
$msgword="";
break;
case 1:
$data_in=$str_form;
if ($data_in=='')
{
$msgword="";
}
elseif ($data_in=='True')
{
//$msgword=$data_in; <——可以输出True
$msgword=show_msg(0);
}
else
{
$msgword="False";
}
break;
default:
echo "haha";
}
echo $msgword;
}
?>
在浏览器中输入a.php?result=True,无法得到输出。
偶现在怀疑是否是用到了php关键字?还是因为嵌套太多的缘故? |
|