PHP Learning Diary (1)---php Quick start

Source: Internet
Author: User

1.1 Submitting data through form form forms

Index.html

<form action= "test.php" method= "POST" >

<input type= "text" name= "username" value= "/>

<input type= "Submit" value= "Submission"/>

</form>

The form jumps to the test.php page, and the form data is passed through the post.

test.php

<?php

$username =$_post[' username '];

echo $username;

?>

$_post is a super global variable that is passed to the array of variables in the script via the Post method.

Other Super Global variables:

$GLBALS all global variable arrays

$_get An array of variables passed to the script by the GET method

$_cookie array of COOKIE variables

$_files array of variables related to file uploads

$_ENV environment variable Array

$_request array of variables for all user input

$_sessioin Session Variable Array

1.2 mutable variables

$a = "B";

$b = "zzz";

echo $ $a; Equivalent to $b

PHP Learning Diary (1)---php Quick start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.