First understanding of PHP, first learning education technology _ PHP Tutorial

Source: Internet
Author: User
Tags php form
PHP and educational technology. First understanding PHP, first learning education technology 1. in PHP, all global variables must be capitalized; 2. in the PHP form submission method, the method attribute sets the method for obtaining and submitting data. 3. if PHP is first recognized in the form, education technology is first recognized.

1. in PHP, all global variables must be capitalized;

2. in the PHP form submission method, the method attribute sets the method for obtaining and submitting data;

3. if an upload element is used in a form, you must add the following attributes to the form: enctype = "multipart/form-data ";

4. implementation of the logout user function:

The code is as follows:


<? Php
Session_start (); // start the session
Unset ($ _ SESSION ['user']); // deletes a single SESSION
Unset ($ _ SESSION ['pwd']); // deletes a single SESSION
Session_destory (); // ends the current session
Header ("location: index. php"); // redirect
?>

Delete multiple sessions: $ _ SESSION = array ();

5. Traverse objects in php:

The code is as follows:


For ($ I = 0; $ I // Process
}

6. php contains files: include ("file path ");

7. how to embed js scripts in the HTML page:

The code is as follows:


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.