解析错误:语法错误,文件意外结束(注册脚本) [英] Parse error: syntax error, unexpected end of file (Registration script)

查看:76
本文介绍了解析错误:语法错误,文件意外结束(注册脚本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的脚本有问题:S

这是错误:解析错误:语法错误,文件意外结束

This is the error:Parse error: syntax error, unexpected end of file

这是完整的代码.我搜索了未关闭的手镯或其他东西,但未找到任何:S 我希望你们中的一些人能够找到问题.

Here is the full code.I searched for not closed bracklets or something but didn't found any :S I hope some of you guys can find the problem.

<?php
include "header.php";
include "menu.php";
?>
<div class="wrapper">
<table width=100%>
    <td valign=top width=230px>
        <div class="login">
        <form name="register" method="post" action="$_SERVER[PHP_SELF]" onsubmit="return validateregister()">
        <input type="text" name="username" placeholder="Username"/><br />
        <input type="password" name="password" placeholder="Password"/><br />
        <input type="password" name="passwordagain" placeholder="Password again"/><br />
        <input type="text" name="email" placeholder="E-mail"/><br />
        <input type="text" name="mcname" placeholder="Minecraft Name"/><br />
        <?php
        $captchaquery = mysql_query('SELECT * FROM general');
        $captcha = mysql_fetch_array($captchaquery);
        if($captcha['captcha'] == 'enabled')
        {
            require_once('functions/recaptchalib.php');
            $publickey = $captcha['captchapublic'];
            echo recaptcha_get_html($publickey);
        }
        ?>
        <input class="btn" type="submit" name="register" value="Register" />
        </form>
        </div>
    </td>
    <td valign=top>
        <div id="errors" style="width:80%; margin-left:auto; margin-right:auto;"></div>
    </td>
</table>
<?php
if(isset($_POST['register']))
{
    if($captcha['captcha'] == 'enabled')
    {
        require_once('recaptchalib.php');
        $privatekey = $captcha['captchaprivate'];
        $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

        if (!$resp->is_valid) {
        die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
    }
    else
    {
    registerUser($_POST['username'], $_POST['password'], $_POST['passwordagain'], $_POST['email'], $_POST['mcname']);
    }
}
include "footer.php";
?>

推荐答案

您忘记了以下语句的右括号:

you forgot the closing bracket on this statement:

if (!$resp->is_valid) {
    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")");
}

这篇关于解析错误:语法错误,文件意外结束(注册脚本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆