Table request, query request, cookiesetcookie

Source: Internet
Author: User
TABLE requests in PHP are simple. The variable $ is added before the name specified by the name. To receive an array, simply specify name = & quot; variable [0] & quot. Table request

TABLE requests in PHP are simple.
The variable $ is added before the name specified by the name.
To receive an array, simply specify the name = "variable [0.
Furthermore, conversion of character codes is unnecessary.

When you run the code below test. php, the test process performs a table request.
Once the data is input Is the initial value of the table.

       
   Table request test      

Upload table request test Upload

\ $ A = $

\ $ B [0] = $ B [0]

\ $ B [1] = $ B [1]

\ $ C = $ c

END_OF_HTML;} else {?>

Enter data.

Query request

Like QUERY_STRING, the query request is as simple as FORM.
Add the $ parameter before the specified query identification name.
What is the image obtained by means of permutation? Variable [0] =.

Use urlencode to filter out English numbers in QUERY_STRING.
$ Para1 = urlencode ($ para1 );

Run the following code of test. php to perform the test.

       
   Query request test      

Pipeline query request test pipeline

\ $ A = $

\ $ B [0] = $ B [0]

\ $ B [1] = $ B [1]

END_OF_HTML;} else {?>

No data.

Terminal data Cookie

In PHP, writing and obtaining cookies is actually very simple.
There are also writing methods for Cookie writing as html meta, but here, setcookie is entered using PHP encoding.
In addition, setcookie and initial execution in HTML are necessary.

Cookie acquisition means that the Cookie is obtained by appending the $ variable before the Cookie name.
Because the cookie exists on the request header, and the setcookie is set by the variable immediately after it is requested, it is the value of the request.
The first round is of course empty.
If you have any questions, process $ cookiename,
$ Cookiename = 'data ';
Setcookie ('cookiename', $ cookiename, time () + 60 );
That's all.

The code below test3.php is used to run the test for Cookie. The Cookie expiration date is 60 seconds.

[Tracing]
Next time test3.php does not work.
Insert
$ Cookiename = $ _ COOKIE ["cookiename"];
It seems to work. (Thank you for your information)

       
   Cookie test      

Renew Cookie test

\ $ Cookiename = $ cookiename

END_OF_HTML;} else {?>

No Cookie data.

When data is loaded again within 60 seconds, the written Cookie is read.

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.