Parse error syntax error unexpected end of file, using PHP

What does this mean?

My page had been working fine, but I updated XAMPP to a newer version, 1.8.1. After that I receive only this error message:

Parse error: syntax error, unexpected end of file in C:xamppindex.php on line 106

<?php
    if (isset($_POST['submit']))
    {
        include('Mysql.php');

        // Include database connection settings
        $username=$_POST['username'];
        $password=$_POST['password'];
        $username = stripslashes($username);
        $password = stripslashes($password);
        $username = mysql_real_escape_string($username);
        $password = mysql_real_escape_string($password);

        // Retrieve username and password from database according to user's input

        $subm = mysql_query("SELECT * FROM usercreation WHERE (UserId = '" .$username. "') and (Password = '" .$password. "')");

        // Check username and password match
        if (mysql_num_rows($subm) == 1)
        {
            session_start();

            // Set username session variable
            $_SESSION['username']=$username;
            //$ss=$_SESSION['username'];

            // Check, if user is already login, then jump to secured page
            if (isset($_SESSION['username']))
            {
                header('Location:master.php');
            }
        }
        else
        {
?>

<script type="text/javascript">
    alert("The username or password you entered is incorrect.");
    document.location='index.php';
</script>

<?
        }
    }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="css/style.css" />
        <title>Mani</title>
    </head>

    <body>
        <center>
            <div style="width:980px;" class="mod-container">
                <div style="width:980px; height:50px;">
                </div>

                <div style="width:980px; height:130px; float:none;">
                   <div style="width:250px; height:130px; float:left; background-image:url(img/logo_mani.png);">
                   </div>
                </div>

                <div style="width:980px; height:350px; float:none;">
                    <div style="width:270px; height:350px; margin-left:10px; float:left;">
                    </div>

                    <div style="width:400px; height:350px; background-image:url(img/loginbg.png); margin-left:10px;float:left;">
                        <!--   Form start here-->
                        <form method="POST" action="<?php $_PHP_SELF ?>">
                            <div style="width:369px; height:275px; margin-left:17px; margin-top:59px; float:left;">
                                <div style="width:321px; height:48px; background-image:url(img/uid.png); margin-left:27px; margin-top:30px; float:left;" class="log">
                                    <input type="text" placeholder="Username" onBlur="this.value=!this.value?'Username':this.value;" onFocus="this.select()" onClick="this.value='';" name="username" value="Username">
                                </div>
                                <div style="width:321px; height:48px; background-image:url(img/pw.png); margin-left:27px; margin-top:29px; float:left;" class="log">
                                    <input type="password" placeholder="Password" onBlur="this.value=!this.value?'Password':this.value;" onFocus="this.select()" onClick="this.value='';" name="password" value="Password">
                                </div>
                                <div style="width:321px; height:29px;  margin-left:27px; margin-top:15px; float:left;" class="logforgot">
                                    <!--   <a href="#" style="">Forgot Password ?</a>-->
                                </div>
                                <div style="width:321px; height:48px;  margin-left:27px; margin-top:19px; float:left;">
                                    <input class="logbutton" type="submit" value="Login" name="submit">
                                </div>
                            </div>
                        <!--   Form end here-->
                        </form>
                    </div>

                    <div style="width:270px; height:350px; margin-left:10px;float:left;">
                    </div>
                </div>
            </div>

            <div id="footer-wrap">
                <div style="width: 980px; height:20px; float:none;">
                    <div style="width: 580px; height:20px; float:left;"class="footercontainer"><p>© 2012 Amara Raja Batteries Limited.</p></div>
                    <div style="width: 210px; height:20px; float:right;"class="footercontainer"><p>All Rights Reserved | Privacy Policy</p></div>
                </div>
            </div>
        </center>
    </body>
</html>

It seems you have a different PHP configuration.

Enable short tags in your php.ini file.

Or convert all <? s in <?php .


确保所有PHP代码都在<?php标签内:

// Line 37
<?php
    }
}
?>
链接地址: http://www.djcxy.com/p/12004.html

上一篇: PHP解析错误:语法错误,CodeIgniter视图中的文件意外结束

下一篇: 使用PHP解析错误语法错误意外结束文件