【发布时间】:2017-06-19 02:13:08
【问题描述】:
好的,所以我最近决定向我的站点添加一个维护页面,它是一个 .php 文件,所以当我启用它来测试它时,即使使用不同的 PC、网络,我也会收到 403 错误。我什至尝试过 VPN .. 谁能解释为什么我启用它时会得到一个 403 页面????
<?php
session_id();
session_start();
ob_start();
date_default_timezone_set('America/Chicago');
$connection = mysql_pconnect("Hidden","Hidden","Hidden"); or die ("Error connecting to database.");
mysql_select_db("Hidden") or die ("Error connecting to database, hang tight, we are working on it.");
mysql_select_db("Hidden") or die ("Error connecting to database, hang tight, we are working on it.");
?>
<style>
body {
color:white;
font-family:Segoe UI;
}
body { background-image:url("http://www.freegreatpicture.com/files/191/20288-gyrosigma-light-blue-background.jpg"); }
#Opacity {
background: url(Opacity.png);
padding:12px;
border:1px solid #969696;
border-radius:6px;
width:380px;
}
h3 {
color:#F5F5F5;
font-size:25px;
margin:0;
padding:0;
padding-bottom:10px;
}
#h3sub {
color:#F5F5F5;
font-size:18px;
}
h2 {
color:#F5F5F5;
text-shadow:1px 0px 0px #999;
margin:0;
padding:0;
padding-bottom:10px;
}
input[type=text] {
width:300px;
background:white;
border:1px solid #999;
padding:4px;
font-family:Segoe UI;
border-radius:5px;
}
input[type=password] {
width:300px;
background:white;
border:1px solid #999;
padding:10px;
font-family:Segoe UI;
border-radius:7px;
}
#btn {
background:rgb(34,51,136);
padding:4px;
border-radius:7px;
color:white;
font-family:Verdana;
font-size:30px;
font-weight:bold;
text-shadow:1px 0px 0px rgb(34,34,34);
</style>
<center><td valign='top'>
<center><img src='http://i.imgur.com/q1CODHB.png'></center>
</td>
<div style='padding-bottom:0px;'></div>
<table>
<h1><B><font color='darkred'>Maintenance Protocol</FONT></B></h1>
<h4><B><font color='darkred'>Gravitar is currently offline for maintenance and upgrades.</FONT></B></h4>
<h4><B><font color='darkred'>You will be redirected back to the website when this process is complete.</FONT></B></h4>
<br>
</br>
<tr>
<td valign='top'>
<div id='Opacity'>
<h0><B><font color='darkblue'>Gravitar</FONT></B></h0>
<h2><font color='darkblue'>Developer Login</FONT></h2>
<form action='' method='POST'>
<table>
<tr>
<td>
<input type='password' name='Password' placeholder='Passcode...'>
</td>
</tr>
<tr>
<td>
<input type='submit' name='submit' value='U'>
<input type='submit' name='submit' value='N'>
<input type='submit' name='submit' value='I'>
<input type='submit' name='submit' value='V'>
<input type='submit' name='submit' value='E'>
<input type='submit' name='submit' value='R'>
<input type='submit' name='submit' value='O'>
<input type='submit' name='submit' value='U'>
<input type='submit' name='submit' value='S'>
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<?php
$Password = mysql_real_escape_string(strip_tags(stripslashes($_POST['Password'])));
$submit = mysql_real_escape_string(strip_tags(stripslashes($_POST['submit'])));
if ($submit) {
$Passcode = "5y24G4H@$%Y56herGerefVVVVVVVerqcdfllllLOLFwew4wF!@#$";
if ($Password == $Passcode) {
$_SESSION['Admin']="hi";
header("Location: index.php");
}
}
echo"<h4><center><font color='darkblue'>© Void Team Corporation. All Rights Reserved.</font></h4></center>";
?>
<?php
echo"</div></div>";
include "../Footer.php";
?>
【问题讨论】:
-
mysql_* 函数已弃用,请使用 mysqli_* 或 PDO。
-
哇!这完全修复了我的代码!天哪!!!
-
很难判断你是否在讽刺。
-
它破坏了整个网站。
-
你需要花时间转换它,参数结构不同。在当前版本的 PHP 中,mysql_* 函数被完全删除,第二次更新 PHP 所有这些函数都将变为未定义。 mysql_* 也有些地方坏了,可能会导致安全问题。