[原创][技术]PHP学习笔记(3)--基础3/3
2013-02-26 15:57
429 查看
今天这一课内容少:
PHP 表单
PHP $_GET
PHP $_POST
正文:
--------------------------------------------------------------------------
PHP表单
先写了一个index.html 内容如下:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
又写了一个welcom.php,内容如下:
Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old.
系统运行,先出来html,如图:
提示输入姓名和年龄,输入stephen及28, 提交之后显示:
Welcome stephen.
You are 28 years old.
---------------------------------------------------------------------------
PHP $_GET
index.html中:
<form action="welcome.php" method="get">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
welcome.php中:
Welcome <?php echo
You are <?php echo
PHP 的 $_REQUEST 变量包含了 $_GET, $_POST 以及 $_COOKIE 的内容。
PHP 的 $_REQUEST 变量可用来取得通过 GET 和 POST 方法发送的表单数据的结果。
Welcome <?php echo $_REQUEST["name"]; ?>.<br />
You are <?php echo $_REQUEST["age"]; ?> years old!
-----------------------------------------------------------------------------
PHP $_POST
上的的PHP表单中已经描述了,不再重复
PHP 表单
PHP $_GET
PHP $_POST
正文:
--------------------------------------------------------------------------
PHP表单
先写了一个index.html 内容如下:
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
又写了一个welcom.php,内容如下:
Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old.
系统运行,先出来html,如图:
提示输入姓名和年龄,输入stephen及28, 提交之后显示:
Welcome stephen.
You are 28 years old.
---------------------------------------------------------------------------
PHP $_GET
index.html中:
<form action="welcome.php" method="get">
Name: <input type="text" name="name" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
welcome.php中:
Welcome <?php echo
$_GET["name"]; ?>.<br />
You are <?php echo
$_GET["age"]; ?> years old!
PHP 的 $_REQUEST 变量包含了 $_GET, $_POST 以及 $_COOKIE 的内容。
PHP 的 $_REQUEST 变量可用来取得通过 GET 和 POST 方法发送的表单数据的结果。
Welcome <?php echo $_REQUEST["name"]; ?>.<br />
You are <?php echo $_REQUEST["age"]; ?> years old!
-----------------------------------------------------------------------------
PHP $_POST
上的的PHP表单中已经描述了,不再重复
相关文章推荐
- [原创][技术]PHP学习笔记(1)--基础1/3
- [原创][技术]PHP学习笔记(2)--基础2/3
- [原创][技术]PHP学习笔记(4)--PHP高级1/2
- [原创][技术]PHP学习笔记(5)--PHP高级2/2
- [原创][技术]PHP学习笔记(6)--PHP与mySQL
- [原创][技术]XML学习笔记(1)------XML 基础
- php基础入门篇学习笔记
- (原创)c#学习笔记08--面向对象编程简介02--OOP技术01--接口
- [学习笔记] Java核心技术 卷一:基础知识 集合(六)
- PHP学习笔记-PHP语言基础1
- 《JAVA2核心技术 卷一 基础知识(原书第七版)》《Core java2,Volume I-Fondamentsls Seven Edition》 学习笔记(二)BREAK和CONTINUE的区别
- java中基础技术学习笔记
- Yupoo! 的网站技术架构_PHP学习笔记
- Java2核心技术第七版的学习笔记(三) Fundamental Programming Structures in Java(Java语言的基础)(三)
- JDBC 学习笔记(一)—— 基础知识 + 分页技术
- 韩顺平PHP学习视频笔记整理023动态网页技术介绍 php基本介绍
- 【NGN学习笔记】VoIP技术基础
- PHP学习笔记-PHP语言基础2
- PHP,thinkphp学习笔记之一 基础环境搭建
- 视音频技术零基础学习笔记(二)