Home  >  Article  >  Backend Development  >  My forum source code (5)_PHP tutorial

My forum source code (5)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:04:05759browse

okey.php mainly handles information processing for user login and publishing


if ($username)                                                                                    .$userpass;
setcookie("FlyFoxNet",$useinfo,time()+3600);

if ($d==q) setcookie("FlyFoxNet"); //If you are exiting , set COOKIE to empty
?>
Publish article

include "linkfox.inc.php";
include "info.inc.php";
function postf($useinfo,$title,$message) //Post information processing
{
$query="select * from foxbbs order by id desc limit 1";
$row=@mysql_query($query);
$info=@mysql_fetch_array( $row);
if ($useinfo[2]==$info[1]&&$title==$info[3]) //Check whether the latest information is the same as the current information.
echo "";
else{
$time=date(Y Year n month j day G hour i minute); $query="insert into foxbbs (usename,ftbq,title,ftdate,mesname,djnum,hfnum,ip) values ​​('".$useinfo[0]."','".$useinfo[14]."', '".$title."','".$time."','".$filename."',1,0,'".$gip."')";
               $req=@mysql_query ($query);
if ($req) { //If the write is successful, add one to the user's post count and create a content file
$query="select ftnum from useinfo where usename='".$ useinfo[0]."'";
$req=@mysql_query($query);
$ftnum=@mysql_fetch_array($req);
$ftnum=$ftnum[0]+1;
           $query="update useinfo set ftnum='$ftnum' where usename='".$useinfo[0]."'";                                                $ FILENAME;
$ fp = Fopen ($ ft, "w"); // Convert all "& lt;", "& gt;" symbols to "& lt;", "& rt;" to remove the HTML mark, " There seems to be a function that can be directly removed, but I can't remember it, and I didn't find it in the reference manual, so I used a stupid method.
        $message=str_replace("<","<",str_replace(">",">",$message)); Remove the symbols and then change the lines so that the newline characters are not displayed as characters.
$f=fputs($fp,$message);
$fp=@fclose($fp);
$fp=fputs($fp,$message);
$fp=@fclose($fp); [2]."!Congratulations, the post was successful!'); ";
                                                                                                                               Sorry, your post could not be saved due to database reasons! '); "; userpass,$title,$message) //User information verification function
{
$query="select * from useinfo where usename='".$username."'";
$req=mysql_query ($query);
$useinfo=mysql_fetch_array($req);
if ($useinfo[0]==$username)
{
//If the check is passed, call the information processing function
if ($userpass==$useinfo[1]) {postf($useinfo,$title,$message);return $useinfo;}
else {
echo "";
  echo " }
}
else
;/script>";
     }
}
?>

< meta HTTP-EQUIV="REFRESH" CONTENT="2;URL=foxbbs.php">

$tem =$HTTP_COOKIE_VARS[FlyFoxNet];
$temp=explode("|",$tem);
$cookiem=$temp[0];
$useinfo=cuser($cookiem,$action);
if (isset($message))
{
if($username)
{
$useinfo=userr($username,$userpass,$title,$message);
}
else if($useinfo) {
userr($useinfo[0],$useinfo[1],$title,$message);
else {echo "";}

}
if ($d==q)
{
echo "";
}
?>






if The system did not automatically return to the page, please click here to return.






http://www.bkjia.com/PHPjc/316102.html

www.bkjia.com

true

http: //www.bkjia.com/PHPjc/316102.html

okey.php mainly handles user login and publishing information processing? if ($username)//Is there user information? $useinfo=$username.|.$userpass; setcookie(FlyFoxNet,$useinfo,time()+3600); if ($d==q...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn