Tips for PHP dynamic Website Development. Many programmers are using 1. naming inputtypecheckboxnamecheckbox [] value $ dwmyrow [banzhu] 2. when using a plan as part of an SQL command: If many programmers are using
1. name
- <Input
- Type = 'checkbox'
- Name = 'checkbox []'
- Value = $ dwmyrow [banzhu]
- />
2. use
When the plan is considered as part of an SQL command: If the field involved in the control is numeric
- if(! empty($_POST['checkbox']))
- {
- $expr = join(",", $_POST['checkbox']);
- $sql = "select * from tbl_name where
field in ($expr)";
- }
If PHP dynamic website development says that the field involved in control is numeric
- if(! empty($_POST['checkbox']))
- {
- $expr = "'".join("','", $_POST
['checkbox']).".";
- $sql = "select * from tbl_name
where field in ($expr)";
- }
PHP checks whether the Form is submitted
- $ Action = $ HTTP_POST_VARS ["Button1"];
- If ($ action = "submit ")
- {
- // Execute the form operation
- }
- Else
- {
- // Read the default value
- }
PHP dynamic website development PHP get string length
- strlen($myrow[1])
PHP Url redirection
- Header("Location: ".
$_SERVER["HTTP_REFERER"]);
Super global object in PHP dynamic Website Development
- < ?php
- $a = 1;
- $b = 2;
- function Sum()
- {
- $GLOBALS["b"] =
$GLOBALS["a"] + $GLOBALS["b"];
- }
- Sum();
- echo $b;
- ?>
PHP form value
If method = "get", replace $ _ GET ["test"] with $ test.
If method = "post", replace $ _ POST ["test"] with $ test.
Obtain the current IP address when developing a PHP dynamic website
-
- =$HTTP_SERVER_VARS["REMOTE_ADDR"]
- ?>
PHP gets the current time
-
- Echo date ("Y-m-d G: I: s ");
- ?>
- Date ("Y, m, d ")
- Date ("Y-n-j ")
The above is a detailed explanation of PHP dynamic website development skills.
Example 1: name input type = 'checkbox' name = 'checkbox [] 'value = $ dwmyrow [banzhu]/2. when a plan is used as part of an SQL command: if you participate in the control...