PHP batch obtains the maximum checkbox Value
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 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 )";
}
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 obtains the string length
Strlen ($ myrow [1])
PHP Url redirection
Header ("Location:". $ _ SERVER ["HTTP_REFERER"]);
PHP super Global Object
<? Php
$ A = 1;
$ B = 2;
Function Sum ()
{
$ GLOBALS ["B"] = $ GLOBALS ["a"] $ GLOBALS ["B"];
}
Sum ();
Echo $ B;
?>
PHP form value
If mothod = "get", replace $ _ GET ["test"] with $ test.
If mothod = "post", replace $ _ POST ["test"] with $ test.
PHP obtains the current IP Address
<? = $ HTTP_SERVER_VARS ["REMOTE_ADDR"]?>
PHP gets the current time
<? Php
Echo date ("Y-m-d G: I: s ");
?>
Date ("Y, m, D ")
Date ("Y-n-j ")