获取403由于某些原因,我认为PHP错误

时间:2017-06-19 02:13:08

标签: php http-status-code-403

好吧所以我最近决定在我的网站上添加一个维护页面,它是一个.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'>&copy Void Team Corporation. All Rights Reserved.</font></h4></center>";
?>
<?php
echo"</div></div>";
include "../Footer.php";
?>

1 个答案:

答案 0 :(得分:-1)

使用PDO连接请求命令作为Mysql连接请求命令被解除使用

如果你甚至得到错误 请按照以下步骤进行操作

检查网址错误并确保您指定实际的网页文件名和扩展名,而不仅仅是目录。大多数网站都配置为禁止目录浏览,因此在尝试显示文件夹而不是特定页面时,403 Forbidden消息是正常的和预期的。

注意:到目前为止,这是网站返回403 Forbidden错误的最常见原因。在投入时间进行下面的故障排除之前,请务必充分探索这种可能性。

确保您使用了正确的包含网址。

确保你在HostManager中给出了正确的CHOMD,你应该给予读写权限。

如果你已经完成它但你仍然无法访问它然后确保如果文件在任何子目录下确保你甚至给予该文件夹的正确的CHOMD权限。

最大可能的错误是**获取访问权限** 所以这将通过以上步骤解决。

因为这是一个HTTP错误你正在使用.php文件,所以一旦预先检查你有任何错误,即使问题可能在你的htaccess文件中。

即使你没有让解决方案随意给我打电话。

希望这两者都能帮助你摆脱错误。