谢谢大哥 !卖血了给你发烟抽
....
<body>
this is a php test!
<?
print("you are $_post[youname]");
?>
</body>
是这样改么??
为什么我还是不行啊
提交表单的动作post已经在前面设定好了啊,怎么还是不行啊??
原谅我太无知,请告诉我好么?
name ="$_post[youname]" 这个变量在第一个页面就这么定义么?
这样我也试过了,也不行啊?
附完整代码 :
/******index.php********/
<html>
<head>
<Title> this is a php test</Title>
</head>
<body>
<Form action="1-6.php" METHOD="post">
your name:
<input type ="text" name=$_POST["yourname"]><br>
cost of a lunch:
<input type ="text" name="CostOfLunch"><br>
days buying lunch:
<input type ="text" name="DaysBuyingLunch"><br><br>
<input type ="submit" name="x" value="compute">
</Form>
</body>
</html>
/********1-5.php**********/
<?
$today =date("l F d, y");
?>
<html>
<head>
<title>listing 1-5</title>
</head>
<body>
today's date:
<?
print("<h1>$today</h1>\n");
print("$YourName, You will be out");
printf($CostOfLunch * $DaysBuyingLunch);
print("dollars this week.<br>\n");
?>
</body>
</html>
提交后页面值能显示:
today'sdate:
sunday ......2004
you will be out doloars this week.
由页面index.php的表单提交的变量似乎没有传递到1-5.php
是什么原因呢?????好苦闷啊?