本节内容:
php页面传值的简单例子
1,index.html
复制代码 代码示例:
< head >留言本首页 - www.jbxue.com Hello,Welcome to imchaotan 留言本
留下您宝贵的建议吧?
2,post.php
复制代码 代码示例:
if(empty($_POST['id'])) { echo "账户不能为空,5秒后自动返回登录界面"; header("refresh:5;URL='index.htm'"); } else if(empty($_POST['guess'])) { echo "文本不能为空,5秒后自动返回登录页面"; header("refresh:5;URL='index.htm'"); } else { $id=$_POST['id']; $guess=$_POST['guess']; echo"Hello".$id."你的留言是".$guess."
"; } ?>
更多php新手相关的教程,请参考php入门教程中介绍的更多内容。