The best message of the challenge of the source code (III)

Source: Internet
Author: User
Tags exit header php file printf strlen
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= ' management message ");
Header (' http/1.0 401 Unauthorized ');
Echo ' needs to be empowered, you do not have the authority to!<br> ';
Echo ' Click Refresh to retry .<br> ';
Exit

}

Else

{

if (strlen ($PHP _auth_user)!=0)
{

if ($action = = "Delete")
echo "I'm sorry, you don't have permission to delete the message!!! <br> ";
else if ($action = "Huifu")
echo "Sorry, you can not recover for the time being, only moderators have this right now!!! <br> ";
Else
echo "Sorry, you do not have the authority to manage the message!!!";
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 "I'm sorry, you don't have permission to delete the message!!! <br> ";
else if ($action = "Huifu")
echo "Sorry, you can not recover for the time being, only moderators have this right now!!! <br> ";
Else
echo "Sorry, you do not have the authority to manage the message!!!";
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 "Delete Error";
}
Else

{
echo "successfully deleted";
echo "<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" > ";
echo "<HTML><HEAD><TITLE> publish article </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> reply successful, will automatically display the message content";
echo "<br>";
echo "<a href=display.php> If your browser does not automatically return to the Guest Book homepage, 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= "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 "Back to Success";




echo "<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 transitional//en" > ";
echo "<HTML><HEAD><TITLE> publish article </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> reply successful, will automatically display the message content";
echo "<br>";
echo "<a href=display.php> If your browser does not automatically return to the Guest Book home page,?
Please click here to return. ";
echo "</a></ul>";


Exit


}



}


Else

printf ("error");


?>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.