0

尝试使用我的register.php脚本时出现以下错误。

Forbidden

You don't have permission to access /register.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

这是脚本:

<?php //error_reporting(E_ALL ^ E_NOTICE); ini_set('display_errors', true);
include('header.php');
if(isset($_POST['register'])){
foreach($_POST as $key => $value) {
    $sec[$key] = filter($value);
}

$verificare1 = mysql_query("SELECT * FROM `users` WHERE `login`='{$sec['user']}' OR `email`='{$sec['email']}'");
$verificare = mysql_num_rows($verificare1);

if ($verificare > 0) {
$mesaj = "<div class=\"error\">ERROR: Username or email already registered!</div>";
}else if (!isUserID($sec['user'])) {
$mesaj = "<div class=\"error\">ERROR: Username is incorrect!</div>";
}else if(!isEmail($sec['email'])) {
$mesaj = "<div class=\"error\">ERROR: Enter a valid email address!</div>";
}else if (!checkPwd($sec['password'],$sec['password2'])) {
$mesaj = "<div class=\"error\">ERROR: Passwords do not match!</div>";
}else{
if(isset($_COOKIE['PlusREF'])){
$ref = $_COOKIE['PlusREF'];
$user1 = mysql_query("SELECT * FROM `users` WHERE `id`='{$ref}'");
$user = mysql_fetch_object($user1);
mysql_query("INSERT INTO `referals`(user,referal,date) values('{$user->login}','{$sec['user']}',NOW())");
}
$activare = rand(000000000, 999999909);
mail($sec['email'],"Welcome to ExchangeBoost.com","
Hello,

Thank you for signing up at ExchangeBoost.com. 

Click on the link below in order to activate your account: 
{$site->site_url}/activate.php?cod={$activare}

If you would like after you activate your account you can buy coins in the UserCP at a very low rate.

Thank you!","From: ExchangeBoost.com <{$site->site_email}>");
$final = VisitorIP();
$passa = $sec['password'];
$passc = MD5($passa);
mysql_query("INSERT INTO `users`(email,login,coins,IP,pass,passdecoded,ref,signup,activate) values('{$sec['email']}','{$sec['user']}','100','$final','$passc','$passa','{$ref}',NOW(),'{$activare}')")or die(mysql_error());
$mesaj = "<div class=\"success\">Registered! You need to confirm your email address now!</div>";
}}
?>  
<div class="main">


            <div class="content-ex">


<div class="msg"><?echo $mesaj;?></div>
<form action="" method="post">

                         <p>
                             <label>Username</label><br/>
                             <input class="text big" type="text" value="" name="user"/>
                         </p>
                         <p>
                             <label>Email</label><br/>
                             <input class="text big" type="email" value="" name="email"/>
                         </p>
                         <p>
                             <label>Password</label> <br/>
                             <input class="text big" type="password" value="" name="password"/>
                         </p>
                         <p>
                             <label>Repeat Password</label> <br/>
                             <input class="text big" type="password" value="" name="password2"/>
                         </p>
                          <p>

                            <input type="submit" class="bbut" value="Register" name="register" />
                          </p>

                    </form>

            </div>
<div class="signin"> 
               <h2>Sign In</h2>
                           <form method="post">

<input class="text big" type="text" value="Username:" name="login">
<input class="text big" type="password" value="Password:" name="pass">           

<div class="buttons">

                            <input type="submit" class="gbut" name="logare" value="Login" /><a class="bbut" href="register.php" name="logare" value="Register">Register</a>
<br><br>
<a href="recover.php">Dude, I forgot my password!</a>
</div>                                        
</form>

            </div>



        </div>


<?include('footer.php');?>
4

3 回答 3

1

检查文件是否真的存在。它存在然后检查你的.htaccess设置。404 Error表示未找到您要查找的页面。

于 2012-12-12T13:40:58.197 回答
0

听起来可能是文件权限错误。您在 Windows 或 *nix 托管环境中吗?文件集的权限是什么?确保 Web 用户具有读取文件的权限。

于 2012-12-12T13:43:11.707 回答
0

这是两个错误

  1. 如错误消息所述,您无权访问路径中的文件。-> 在这种情况下,您是指正在处理请求的网络服务器进程,例如 apache。您需要检查文件权限,确保该文件可以被 Web 服务器读取。进一步,你需要检查路径是否正确,它直接在web根目录中查找register.php
  2. 您的网络服务器配置为提供错误 (html) 文档,但找不到此错误文档(例如 404.html)
于 2012-12-12T13:58:13.690 回答