php中的全局变量$_REQUEST
2016-01-31 20:23
513 查看
test2.php:
<!-- 在这个程序中做到的不仅仅是对$_REQUEST这个全局变量的演示,还有重要的是
对php文件的书写,在这个程序中我们写了两个文件,其中一个是test2.php,还有一个test3.php
其实第一个php文件主要是网页,我们在里面定义一个表单,然后action="test3.php"这样两个文件之间
就有了关联,其实我们主要是在这个程序中演示方法post,然后在另外的文件中接收,这个全局变量是用于数
据的传递 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form method="post" action="test3.php">
Name:<input type="text" name="fname">
<input type="submit">
</form>
</body>
</html>
test3.php:
<?php
$name=$_REQUEST['fname'];
echo $name;
?>
在这个地方我们看到的是$_REQUEST这个全局变量,这个全局变量主要是用于数据的传递,我们可以定义表单
接收用户的输入,获取特定表单中的数据。
<!-- 在这个程序中做到的不仅仅是对$_REQUEST这个全局变量的演示,还有重要的是
对php文件的书写,在这个程序中我们写了两个文件,其中一个是test2.php,还有一个test3.php
其实第一个php文件主要是网页,我们在里面定义一个表单,然后action="test3.php"这样两个文件之间
就有了关联,其实我们主要是在这个程序中演示方法post,然后在另外的文件中接收,这个全局变量是用于数
据的传递 -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<form method="post" action="test3.php">
Name:<input type="text" name="fname">
<input type="submit">
</form>
</body>
</html>
test3.php:
<?php
$name=$_REQUEST['fname'];
echo $name;
?>
在这个地方我们看到的是$_REQUEST这个全局变量,这个全局变量主要是用于数据的传递,我们可以定义表单
接收用户的输入,获取特定表单中的数据。
相关文章推荐
- PyQuery基本操作介绍
- 和为0的4个值(4 Values Whose sum is Zero UVa 1152)
- NGUI ScrollView 最彻底优化方案 加载大量(百万级)Item不卡的()
- Bluez调试工具hcitool与gattool的使用实例
- iOS使用XZMRefresh实现UITableView或UICollectionView横向刷新
- B. Guess the Permutation
- UINavigationController练习
- 修改Request 中的数据
- RabbitMQ学习笔记
- Intergraph CADWorx (Plant, P&ID, Equipment, IP, SpecEditor) 2016 v16.0-ISO 1DVD
- java.sql.SQLException: General error, message from server: "Field 'ID' doesn't have a default value
- java.net.SocketException: Can't assign requested address
- busybox filesystem matrix-gui-2.0 undefined function json_encode()
- UItextView回收键盘的几种方式
- LeetCode Unique Binary Search Trees
- android-Building a Notification,Preserving Navigation when Starting an Activity
- Codeforces 67C Sequence of Balls 编辑距离 dp
- BZOJ-1206 虚拟内存 Hash+离散化+Priority_Queue
- BZOJ-1206 虚拟内存 Hash+离散化+Priority_Queue
- iOS UITextField