1. php calls the system time in PHP. set the Default Time Zone in ini: Find data. timezone = remove the; sign before it, and then set data. timezone = "Asia/Shanghai.
Call method: date ("Y-m-d h: I: s") automatically returns a system time string.
2. Insert the PHP code in HTML:
Automatically enter the username :______
<HTML> <? Phprequire_once 'common. php';?> <Form action = "loginprocess. php" method = "Post"> Username: <type = "text" name = "name" value = "<? PHP echo getcookieval ("ID") ;?> "/> </Form>
<?php function getCookieVal($key){ if(!empty($_COOKIE($key))){ return $_COOKIE($key); }else{ return ""; } } ?>
3. The cookie stores the key-value pair and the duration of the key-value pair. $ Key => $ Val
You can use setcookie to set, modify, and delete existing key-value pairs;
Use $ _ cookie [''] to obtain the cookie;
Empty ($ _ cookie ['']) is used to determine whether a corresponding key-Value Pair exists.
4. Cookies are stored on the browser client. When the browser wants to access an address, it sends an HTTP request to the server, and then the server sends the PHP page back to the browser. When the browser enters certain information such as the user name and password on the PHP page, PHP will save the information in cookie form on the client. When the browser accesses the page again, the cookie is sent to the server when an HTTP request is sent, and the server displays the specific cookie information that was originally saved.
Defect: Cookie transmission consumes a certain amount of bandwidth, and security issues exist (username, password, and other information is continuously transmitted over the Internet)