PHP batch gets the value of checkbox
1. Name
2. Use
When the plan is used as part of the sql instruction: If the fields participating in the control are numerical, then
if(! empty($_POST['checkbox'])) {
$expr = join("," , $_POST['checkbox']);
$sql = "select * from tbl_name where field in ($expr)";
}
If the field participating in the control is numeric, then
if(! empty($_POST['checkbox'])) {
$expr = "'".join("','", $_POST['checkbox']).".";
$sql = "select * from tbl_name where field in ($expr)";
}
PHP determines whether the Form is submitted
$action=$HTTP_POST_VARS["Button1"];
if($ action=="Submit")
{
//Perform form operation
}
else
{
//Read default value
}
PHP Get character String length
strlen($myrow[1])
PHP Url redirection
Header("Location: ".$_SERVER["HTTP_REFERER"]);
PHP superglobal object
< ?php
$a = 1;
$b = 2;
function Sum()
{
$GLOBALS["b"] = $GLOBALS["a"] $GLOBALS[ "b"];
}
Sum();
echo $b;
?>
PHP form value
If method="get", use $_GET[ "test"] instead of $test
If method="post", use $_POST["test"] instead of $test
PHP gets the current IP
=$HTTP_SERVER_VARS["REMOTE_ADDR"]? >
PHP Get the current time
echo date("Y-m-d G:i:s");
?>
date("Y year m month d day ")
Date ("Y-n-j")