大家帮我看看这个问题,谢谢了。很简单的!

qiujianben 2002-07-20 10:42:32
《input.php》
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<form method="post" action="count.php">
请填写您的姓名:
<input type="text" name="yourname">
<br>
书籍单价:
<input type="text" name="costofonebook">
<br>
选购书籍数目;
<input type="text" name="NumberOfDaysBuying">
<br>
<input type="submit" value="计算消费总额">
</form>
</body>
</html>


《count.php》
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<?php
$Today=date("l F d,Y");
print ("<H3>$Today</H3>\n");
print ("您好".$yourname.",一共消费了");
print ($costofonebook*$NumberOfDaysBuying);
print " 元。";
?>
</body>
</html>

错误如下:
Saturday July 20,2002

Notice: Undefined variable: yourname in D:\myWeb\ex_6\count.php on line 11
您好,一共消费了
Notice: Undefined variable: costofonebook in D:\myWeb\ex_6\count.php on line 12

Notice: Undefined variable: NumberOfDaysBuying in D:\myWeb\ex_6\count.php on line 12
0 元。
请大家帮我看看,为什么说我没有定义变量?
...全文
75 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
LeeMaRS 2002-07-20
  • 打赏
  • 举报
回复
与PHP的设置有关,请修改php.ini,把register_globals设为On
qiujianben 2002-07-20
  • 打赏
  • 举报
回复
我没有重启服务。也可以了,对了你的qq多少?能交个朋友吗?
我用的iis+php做调试!
LeeMaRS 2002-07-20
  • 打赏
  • 举报
回复
是的,要重启HTTP服务器。
qiujianben 2002-07-20
  • 打赏
  • 举报
回复
解决了!谢谢。给分!
qiujianben 2002-07-20
  • 打赏
  • 举报
回复
还是没有解决阿?一样的结果。是不是要重启www服务?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧