Jump to content

Unexpected $end on line 109, but i cant see why???


PC Nerd

Recommended Posts

hi guys

i am creating this login script, but i am getting the following error:

Parse error: parse error, unexpected $end in C:\xampp\xampp\htdocs\Battle-Ages\B_A-Login.php on line 109


now the weird thing is that this line is the very last line in the entire page: "</html>", so even the php has finished giving our output, and being used.

here is my code...., can anyone help me with this error


[code]<html>

<head>
<link rel="stylesheet" type="text/css" href="B_A-CSS.css">
<title>Battle Ages Login</title>
</head>

<body>


<table>

<thead>
<td>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'left'>
</td>

<td>
</td>

<td>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'right'>
</td>

</thead>

<tbody>
<tr>

<td class = left>
</td>

<td class = centre>


<?php

include("inc_files/Database_link.inc");

$User_Name = $_POST['User_Name'];
$Login_SQL = "SELECT User_Name, Password FROM Table_1 WHERE User_Name = '" .$User_Name."'";

$result = @mysqli_query($DB_Server, $Login_SQL);

if($result){

$confirm = @mysql_fetch_array($result);

if($confirm['User_Name'] == $_POST['User_Name'] and $confirm['Password'] == $_POST['Password'] and $_POST['Pic_Value'] == $_POST['Pic_Name']){

$Cookie_SQL = "SELECT * FROM Table_1 WHERE User_Name = '".$_POST['User_Name']."'";

        $G_Stats_Query = @mysqli_query($DB_Server, $Cookie_SQL);

if(!$result){
                echo "there was an error with the database connection.  Although we were able to valadate your login, we cannot retrive your game stats from the database.  If this persists please contact us.";
          }
            else{
          }

        $Cookie_Create = @mysql_fetch_array($G_Stats_Query);

        if(!$Cookie_Create){

echo "We cannot retrive your game stats.  please try to login again.  if this problem persists, please contact us.";
        }

        else{
           
        include("inc_files/B_A-Create_Cookies.inc");

        echo "<form action = 'B_A-Base.php' method = 'POST'>";
echo "<input type = 'submit' value = 'Login'>";
echo "</form>";

}

echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us.<a href = 'B_A-Home.html'>Home</a></p><br><br>";

}


else{

echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us. <a href = 'B_A-Home.html'>Home</a></p><br><br>";
echo "Error"."$mysqli_error($result)";

}
echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us. <a href = 'B_A-Home.html'>Home</a></p><br><br>";"
}
}

?>



</td>

<td class = right>
</td>

</tr>
</tbody>
</table>

</body>

</html>[/code]

thanks for any help in advance
Link to comment
Share on other sites

ok, now thats fixed, but im getting no output, even the button from the form????, why i cant see any error output, just the two images at the top, which arent even spaced correctly, even though the same code is used on every single page that ive made and it works on all those????? i just dont know whats happening
Link to comment
Share on other sites

ok, i changed that if() to that, and the other if thatr uses the $result..... to if(empty($result)) {........, im not getting any error, but im not getting anything either, just as though i had not changed a thing....??? any more ideas
Link to comment
Share on other sites

i fixed the first if() one with that...... but the second one inside that if() that tests if $reslut is empty i changed to the if(empty($result)) {}, but thats just stupid i now relise, becauase weve already tested if the $result variable is empty.....hang on ill change it
Link to comment
Share on other sites

ok, this is the code i have:, but its not giving any output, except the two image logos as the top, and the css link:


[code]<html>

<head>
<link rel="stylesheet" type="text/css" href="B_A-CSS.css">
<title>Battle Ages Login</title>
</head>

<body>


<table>

<thead>
<td>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'left'>
</td>

<td>
</td>

<td>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'right'>
</td>

</thead>

<tbody>
<tr>

<td class = left>
</td>

<td class = centre>


<?php

include("inc_files/Database_link.inc");

$User_Name = $_POST['User_Name'];
$Login_SQL = "SELECT User_Name, Password FROM Table_1 WHERE User_Name = '" .$User_Name."'";

$result = @mysqli_query($DB_Server, $Login_SQL);

if(!empty($result)){

$confirm = @mysql_fetch_array($result);

if($confirm['User_Name'] == $_POST['User_Name'] and $confirm['Password'] == $_POST['Password'] and $_POST['Pic_Value'] == $_POST['Pic_Name']){

$Cookie_SQL = "SELECT * FROM Table_1 WHERE User_Name = '".$_POST['User_Name']."'";

        $G_Stats_Query = @mysqli_query($DB_Server, $Cookie_SQL);

        $Cookie_Create = @mysql_fetch_array($G_Stats_Query);

        if(!$Cookie_Create){

echo "We cannot retrive your game stats.  please try to login again.  if this problem persists, please contact us.";
        }

        else{
           
        include("inc_files/B_A-Create_Cookies.inc");

        echo "<form action = 'B_A-Base.php' method = 'POST'>";
echo "<input type = 'submit' value = 'Login'>";
echo "</form>";

}

echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us.<a href = 'B_A-Home.html'>Home</a></p><br><br>";

}


else{

echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us. <a href = 'B_A-Home.html'>Home</a></p><br><br>";
echo "Error"."$mysqli_error($result)";

}
echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us. <a href = 'B_A-Home.html'>Home</a></p><br><br>";
}


?>



</td>

<td class = right>
</td>

</tr>
</tbody>
</table>

</body>

</html>[/code]
Link to comment
Share on other sites

I coulda swore we discussed this earlier, tisk tisk! 

On line 55, Cookie_Create is not a boolean value aka true/false, it is a mysql_query result aka an array of values, therefore calling it on line 57 as if(!$Cookie_Create) is trying to call it as a boolean value.  Instead we call it as if(empty($Cookie_Create)) {

Try this:

[code]<html>

<head>
<link rel="stylesheet" type="text/css" href="B_A-CSS.css">
<title>Battle Ages Login</title>
</head>

<body>


<table>

<thead>
<td>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'left'>
</td>

<td>
</td>

<td>
<img src="Graphics\Small_Logo.GIF" alt="Logo" width = '75%' hight = '75%' align = 'right'>
</td>

</thead>

<tbody>
<tr>

<td class = left>
</td>

<td class = centre>


<?php

include("inc_files/Database_link.inc");

$User_Name = $_POST['User_Name'];
$Login_SQL = "SELECT User_Name, Password FROM Table_1 WHERE User_Name = '" .$User_Name."'";

$result = @mysqli_query($DB_Server, $Login_SQL);

if(!empty($result)){

$confirm = @mysql_fetch_array($result);

if($confirm['User_Name'] == $_POST['User_Name'] and $confirm['Password'] == $_POST['Password'] and $_POST['Pic_Value'] == $_POST['Pic_Name']){

$Cookie_SQL = "SELECT * FROM Table_1 WHERE User_Name = '".$_POST['User_Name']."'";

        $G_Stats_Query = @mysqli_query($DB_Server, $Cookie_SQL);

        $Cookie_Create = @mysql_fetch_array($G_Stats_Query);

        if(empty($Cookie_Create)){

echo "We cannot retrive your game stats.  please try to login again.  if this problem persists, please contact us.";
        }

        else{
           
        include("inc_files/B_A-Create_Cookies.inc");

        echo "<form action = 'B_A-Base.php' method = 'POST'>";
echo "<input type = 'submit' value = 'Login'>";
echo "</form>";

}

echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us.<a href = 'B_A-Home.html'>Home</a></p><br><br>";

}


else{

echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us. <a href = 'B_A-Home.html'>Home</a></p><br><br>";
echo "Error"."$mysqli_error($result)";

}
echo "<p>There has been an error with the login, please try to login again.  If the problem persists, please contact us. <a href = 'B_A-Home.html'>Home</a></p><br><br>";
}


?>



</td>

<td class = "right">
</td>

</tr>
</tbody>
</table>

</body>

</html>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.