//form.html
<html><head><title></title></head>
<body>
<form action="deal.php" method="post">
用户名:<input type="text" name="uname" size=20><br>
<input type="submit" value="OK">
</form>
</body>
</html>
//deal.php
<?php
echo "你的用户名为:".$_POST['uname'];
?>
<html><head><title></title></head>
<body>
<form action="deal.php" method="post">
用户名:<input type="text" name="uname" size=20><br>
<input type="submit" value="OK">
</form>
</body>
</html>
//deal.php
<?php
echo "你的用户名为:".$_POST['uname'];
?>
1、注册一个SESSION(cookie)
2、通过URL传递$uname
get,post,session在最新的php版本中自动全局变量是关闭的,所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$_POST['foo'],$_SESSION['foo']来得到
当然也可以修改自动全局变量为开(php.ini改为register_globals = On);考虑到兼容性,还是强迫自己熟悉新的写法比较好。
TO: luxuezhu(卢冲) http://www.phpe.net/articles/222.shtml你去看看,那里说了,要我自己说不太清楚。不过里面的教程有好多错误的例子,我发了两个帖子都是因为他们的程序错误,而我又是一个菜鸟!
这里的朋友真好!!!我喜欢!!
ustcfrank(阿卡波糖) 接分哦