Home >Backend Development >PHP Tutorial >Rookie's PHP Notes (4)
I started reading add.php today. The add code is a little longer than index.
include("config.php");
include("function.php");
$rand=rand(0,9999); //Random number.
if($HTTP_POST_VARS['action']=="Submit"){ //Don't quite understand this variable? Can you write Chinese directly?
$randc=$_REQUEST[randc];
$namecc=$_REQUEST[$randc];
$content=$_REQUEST[content];//I don’t know what the above three sentences are for.
$result.=checkuser($namecc);
$result.=checkemail($HTTP_POST_VARS['email']);//$_POST['email']? ?
$result.=checkqq($HTTP_POST_VARS['oicq']);///////////
$result.=checkcontent($HTTP_POST_VARS['message']);/////// ////
$result.=checkkw($noword,$HTTP_POST_VARS['message']);/////////////
if($result){
error($result);/ /Use the functions defined in function.php to confirm user information.
}
if(file_exists($dbtable)){
$fp=file($dbtable);
$num=count($fp)+1;
}else{
$num=1;
}
$ip =getenv("REMOTE_ADDR");
$addtime=date("Y-m-d H:i:s");
$fp=fopen("$dbtable","a+");
$message=htmlspecialchars($HTTP_POST_VARS[' message']);////////////
if($ubb==1){
$message=ubb($message);
}
//echo $message;
$all=" $num|chjia_com|$_POST[namecc]|chjia_com|$_POST[email]|chjia_com|$_POST[sex]|chjia_com|$_POST[oicq]|chjia_com|";
$all.="$_POST[homepage] |chjia_com|$ip|chjia_com|$addtime|chjia_com|$_POST[phone]|chjia_com|$_POST[pw]|chjia_com|$messagen";
@fputs($fp,$all) or die(error('write An error occurred while entering the information!'));
isok("Add message successfully! Please wait...");
}
?>
The above are the rookie's PHP notes (4) Content, please pay attention to the PHP Chinese website (www.php.cn) for more related content!