This article does not talk about the code, but only talks about the design concept of the PHP message board and the technical processing used in it. Friends in need can refer to it.
-Design a program flow
1. Functional requirements
2. Page design
3. Database design
4. Code design
5. Debug and release
-Form
1.form>
2.method: method of transmitting form data to the server
Post (indicates embedding form data in Http requests)
GET (indicates that the form data is attached to the URL of the request) default method
Difference:
a.Get transmits a small amount of data, which is mainly limited by the length of the URL; while Post can transmit a large amount of data.
B.get is relatively low in security, but the execution efficiency is better than POST.
Receive parameters:
POST method: $_POST['name']
GET method: $_GET['name']
Note: $_POST and $_GET must be in uppercase letters;
PHP5.0 or above will be reported to the notice level error without quotation. It is necessary to develop good writing habits and standardized. Of course, turning off display_error is another matter.
Charging
$_POST: It is an array composed of variables passed by the HTTP POST method
$_GET: It is an array composed of variables passed by the HTTP GET method
$_COOKIE: It is an array composed of variables passed by HTTP Cookies
$_SESSION: It is an array containing session variables in the current script
Suggestions
1.GET is less secure than POST. If confidential information is included, it is recommended to use POST
2. Use GET
when paginating
3. Commonly used controls
a. Single-line text box
Multi-line text box
b. Password box
C. Multi -choice box & lt; input type = checkbox check & gt; (checked attribute indicates the selection status)
D. Single box & lt; input type = radio checked & gt;
e. Drop-down menu
//selected specifies that the initial state of the option is selected
Submit button
Reset button
4.Date/time function
php:date,time;
mysql:now
-javascript verification
Onsubmit: Triggered when the submit button is clicked. If the content is "return function_name();" and the function returns FALSE, the form will not be submitted.
-First introduction to COOKIE
setcookie(name,value,time);
Note: PHP cookies must be refreshed once to take effect.