Action. php file
<? Php
Require ('config. php ');
$ Action = $ arr_request ['action'];
$ Key_liuyan = $ arr_request ['key _ liuyan '];
If (! Isset ($ PHP_AUTH_USER ))
{
Header ('www-Authenticate: Basic realm = "manage messages "');
Header ('HTTP/1.0 401 unauthorized ');
Echo 'requires authorization. You do not have this permission! <BR> ';
Echo 'click refresh to retry. <br> ';
Exit;
}
Else
{
If (strlen ($ PHP_AUTH_USER )! = 0)
{
If ($ action = "delete ")
Echo "Sorry, you have no permission to delete the message !!! <Br> ";
Else if ($ action = "huifu ")
Echo "sorry, you cannot recover it now. Now only the moderator has this permission !!! <Br> ";
Else
Echo "Sorry, you have no permission to manage message books !!! ";
Exit;
}
$ Pass = $ PHP_AUTH_PW;
// Echo $ pass;
$ Result = 0;
While ($ pass % 10! = 0)
{
$ Result = $ result + $ pass % 10;
$ Pass = ($ pass-$ pass % 10)/10;
// Echo $ result;
// Echo "<br> ";
}
$ Tt = $ result * 222;
// Echo $ tt;
If (! Checkpass ($ tt, $ action, $ db_name, $ table_name_control, $ id_link ))
{
If ($ action = "delete ")
Echo "Sorry, you have no permission to delete the message !!! <Br> ";
Else if ($ action = "huifu ")
Echo "sorry, you cannot recover it now. Now only the moderator has this permission !!! <Br> ";
Else
Echo "Sorry, you have no permission to manage message books !!! ";
Exit;
}
}
If ($ action = "delete ")
{
// Printf ("delete ");
// Echo $ key_liuyan;
$ Str_ SQL = "delete from $ table_name where key_liuyan = $ key_liuyan ";
$ Re = mysql_db_query ($ db_name, $ str_ SQL, $ id_link );
If (! $ Re)
{
Echo "deletion error ";
}
Else
{
Echo "successfully deleted ";
Echo "<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> ";
Echo "<HTML> <HEAD> <TITLE> post </TITLE> ";
Echo "<META content =" text/html; charset = gb2312 "http-equiv = Content-Type> ";
Echo "<meta HTTP-EQUIV =" REFRESH "CONTENT =" 2; URL = display. php "> ";
Echo "Echo "<ul> the response is successful, and the message content is displayed automatically ";
Echo "<br> ";
Echo "<a href = display. php> If your browser does not return to the homepage of the message book automatically, click here ";
Echo "</a> </ul> ";
}
}
Else if ($ action = "huifu ")
{
// Printf ("huifu ");
// Echo $ key_liuyan;
?>
<Form action = "action. php? Action = OK "method =" post ">
<Input type = "hidden" name = "key" value = "<? Php echo $ key_liuyan?> ">
<Textarea name = "huifu" cols = "50" rows = "6"> </textarea>
<Input type = "submit" value = "reply">
</Form>
<? Php
}
Else if ($ action = "OK ")
{
$ Key = $ arr_request ['key'];
$ Huifuold = $ huifu;
$ Time = date ('y/m/d H: I: s ');
$ Time = '('. $ time. ') <br> ';
$ Huifuold = $ time. $ huifuold;
$ Huifu_ OK = computer_message ($ huifuold, $ hang_zifu_number );
If (strlen ($ key) = 0)
{Echo "error ";
Exit;
}
$ Str_ SQL = "update $ table_name set huifu_biaozi = 1,
Huifu = '$ huifu_ OK' where key_liuyan = $ key ";
// Echo $ str_ SQL;
$ Re = mysql_db_query ($ db_name, $ str_ SQL, $ id_link );
If (! $ Re)
{
Echo "Update error ";
}
Else
{
Echo "Reply successful ";
Echo "<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN"> ";
Echo "<HTML> <HEAD> <TITLE> post </TITLE> ";
Echo "<META content =" text/html; charset = gb2312 "http-equiv = Content-Type> ";
Echo "<meta HTTP-EQUIV =" REFRESH "CONTENT =" 2; URL = display. php "> ";
Echo "Echo "<ul> the response is successful, and the message content is displayed automatically ";
Echo "<br> ";
Echo "<a href = display. php> If your browser does not automatically return to the homepage of the message book ,?
Click here to return .";
Echo "</a> </ul> ";
Exit;
}
}
Else
Printf ("error ");
?>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]