木子屋 Dnawo's BLOG

PHP获取post和get方法发送的数据的方法

👤 dnawo 📅 2008-06-17 👁 9718 👍 0 💬 0 🔄 本站原创
1.PHP获取get方法发送的数据

<form action="#" method="get">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
<?php echo "Name:".$_GET["name"]."<br/>Age:".$_GET["age"]; ?>

2.PHP获取post方法发送的数据

<form action="#" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
<?php echo "Name:".$_POST["name"]."<br/>Age:".$_POST["age"]; ?>

评论(0)

暂无评论。

计算题
评论需审核通过后显示
← 上一篇 只能用关联数组访问属性的对象 下一篇 → VBscript和JavaScript编写的子过程和函数异同