Hi , I edited my webpage and this occured

Parse error: syntax error, unexpected $end in /home/techgeek/public_html/FrF/test.php on line 59

I have checked all the tags and they are closed and here is the code.

<?php
include("include/session.php");
global $database;
$config = $database->getConfigs();
?>

<html>
<head>
<title><?php echo $config['SITE_NAME']; ?> - Main</title>

<style type="text/css">
<!--
body {
    font: 12px/1.5 Lucida Grande, Arial, Helvetica, 'Liberation Sans', FreeSans, sans-serif;    
}
-->
</style>
</head>
<body>

<table>
<tr><td>


<?php
if($session->logged_in){
   echo "<h1>Logged In</h1>";
   echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;"
       ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
   if($session->isAdmin()){
      echo "[<a href=\"admin/index.php\">Admin Center</a>] &nbsp;&nbsp;";
   }
   echo "[<a href=\"process.php\">Logout</a>]";
}
else{
?>

<?php
if($form->num_errors > 0){
   echo $form->num_errors." error(s) found";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>>
Remember me &nbsp;&nbsp;&nbsp;&nbsp;
<input type="hidden" name="sublogin" value="1">
<input type="submit" value="Login"></td></tr>
</table>
</form>

</td></tr>
</table>
<?php
}
echo "<br><br>";
include("include/view_active.php");
?>

</body>
</html>

It happens when I remove this code

<?php
    }
    echo "<br><br>";
    include("include/view_active.php");
    ?>

Then this is the code

 <?php
    include("include/session.php");
    global $database;
    $config = $database->getConfigs();
    ?>

    <html>
    <head>
    <title><?php echo $config['SITE_NAME']; ?> - Main</title>

    <style type="text/css">
    <!--
    body {
        font: 12px/1.5 Lucida Grande, Arial, Helvetica, 'Liberation Sans', FreeSans, sans-serif;    
    }
    -->
    </style>
    </head>
    <body>

    <table>
    <tr><td>


    <?php
    if($session->logged_in){
       echo "<h1>Logged In</h1>";
       echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
           ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] &nbsp;&nbsp;"
           ."[<a href=\"useredit.php\">Edit Account</a>] &nbsp;&nbsp;";
       if($session->isAdmin()){
          echo "[<a href=\"admin/index.php\">Admin Center</a>] &nbsp;&nbsp;";
       }
       echo "[<a href=\"process.php\">Logout</a>]";
    }
    else{
    ?>

    <?php
    if($form->num_errors > 0){
       echo $form->num_errors." error(s) found";
    }
    ?>
    <form action="process.php" method="POST">
    <table align="left" border="0" cellspacing="0" cellpadding="3">
    <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
    <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
    <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <?php if($form->value("remember") != ""){ echo "checked"; } ?>>
    Remember me &nbsp;&nbsp;&nbsp;&nbsp;
    <input type="hidden" name="sublogin" value="1">
    <input type="submit" value="Login"></td></tr>
    </table>
    </form>

    </td></tr>
    </table>

    </body>
    </html>

I have looked every where in the code and can't see the problem when I look at line 59 it is

</html>

and there is

<html> 

and 

</html>

start and end

Please Help Fast.

Thank You In Advance.

Member Avatar for diafol

You seem to be missing a closing brace (}). I'm assuming it's to do with the conditional block starting on line 26 of your last code snippet.

You have an open brace {, then an }else{, but no closing brace }

commented: Thanks , This solved my problem. +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.