Today, I started to read add. php. the add code is a little longer than the index .? Include (config. php); include (function. php); $ randrand (0,9999); random number. If ($ HTTP_POST_VARS [read add. php today, the add code is a little longer than the index.
Include ("config. php ");
Include ("function. php ");
$ Rand = rand (); // random number.
If ($ HTTP_POST_VARS ['action'] = "submit") {// do not quite understand this variable? Can I write Chinese directly?
$ Randc =$ _ REQUEST [randc];
$ Namecc =$ _ REQUEST [$ randc];
$ Content = $ _ REQUEST [content]; // the preceding three sentences do not know what to do.
$ 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 function defined in funtion. 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 | $ message \ n ";
@ Fputs ($ fp, $ all) or die (error ('Error when writing information! '));
Isok ("message added successfully! Please wait ...");
}
?>
The above is the content of Cainiao's PHP note (4). For more information, see PHP Chinese website (www.php1.cn )!