Home > Backend Development > PHP Tutorial > PHP学习日记(1)-PHP快速入门

PHP学习日记(1)-PHP快速入门

WBOY
Release: 2016-06-23 13:09:19
Original
1026 people have browsed it

1.1通过FORM表单提交数据

  index.html

  

    

    

  

  通过表单会跳转至test.php页面,并且会通过post方式把表单数据一起传过去。

  test.php

  

  $username=$_POST['username'];

  echo $username;

  ?>

  $_POST是超级全局变量,通过POST方法传递给该脚本的变量数组。

  其他超级全局变量:

  $GLBALS 所有全局变量数组

  $_GET 通过GET方法传递给该脚本的变量数组

  $_COOKIE cookie变量数组

  $_FILES 与文件上传相关的变量数组

  $_ENV 环境变量数组

  $_REQUEST 所有用户输入的变量数组

  $_SESSIOIN 会话变量数组

1.2 可变变量

  $a="b";

  $b="zzz";

  echo $$a;  //相当于$b

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template