PHP中文俱乐部's Archiver

eric.lee 发表于 2008-8-6 00:21

请教问题,为何变量year的值在第二个页面不能输出

文件1.php

[php]<form name="form1" method="post" action="2.php">请输入年份:
<input name="year" type="text" id="year" size="5" maxlength="4" >
<input type="submit" name="Submit" value="发送">
</form>[/php]

文件2.php

[php]<?PHP
echo "您所输入的年份为:";
echo $year;
?>[/php]


在下使用的是xp+iis+php5.2.6;谢谢

fyas 发表于 2008-8-7 12:41

回复: 请教问题,为何变量year的值在第二个页面不能输出

$year 引用不对

LAMP兄弟连 发表于 2008-9-8 14:41

回复: 请教问题,为何变量year的值在第二个页面不能输出

楼上的几位不会汉语吗 看不懂~~

抽烟的蚊子 发表于 2008-9-10 20:18

[php]<?PHP
echo "您所输入的年份为:";
echo $_POST['year'];
?>
[/php]

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.