Jump to content

Help with Parse error: syntax error, unexpected $end in ...T2.php on line 52


s-o-s

Recommended Posts

Hi Just started with web design got a dummies for windows book.

Have set up a MySQL Database, got the database populating the title and some info at the top of my page.

Then wanted to add a section at the bottom of all the websites in my group, by putting their website link and name in the footer, as soon as I added this to the page I hit the above error.

I have now stripped out all the other parts of the page to just leave the footer...Problem is still there, have been pulling out hair for 2 hours last night and this morning ...any help greatly received...(ps line 52 = </html> closing tag).

 

Ive done a search and each one of these problems seems to be a small but created by a different cause, I just can't see a missing : or } etc I'm just going blind looking.

Thanks for your help!

 

Here's the code.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="EN" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <meta http-equiv="content-type" content="text/xml; charset=utf-8" />
    <title>Territory Title</title>
  </head>

  <body>

<?php
   
          $terrID=1; //Temporary Set Value of Default Territory
     
         /* Data of SQL-server */
          $server= "**********";     /* Address of database server */
          $user= "*********";             /* Database user name */
          $password= "*******";        /* Database Password */
          $database= "*******";          /* name of database */
          $table= "Territories";             /* Name of table, you can select that */

          /* Accessing SQL-Server and querying table */
          MYSQL_CONNECT($server, $user, $password) or die ( "<H3>Server unreachable</H3>");
          MYSQL_SELECT_DB($database) or die ( "<H3>Database non existent</H3>");

          // Get Territory Information Query   
            $result=MYSQL_QUERY("SELECT Info, PTitle, TTitle, Logo FROM $table Where TerritoryID=$terrID");
               list ($territoryInfo, $territoryPageTitle, $territoryTitle, $territoryLogo) = mysql_fetch_row($result);

          // Get the list of valid Websites for footer
            $webSites="";
            $result=MYSQL_QUERY("SELECT TTitle, Website FROM $table");
            while (list($TTitle, $Website) = MYSQL_FETCH_ROW($result)) {
              $webSites .= "<a href=$Website> $Website - $TTitle, </a>";
            }

          Print <<< HERE
   
    <div id="footer">
      <p> © Copyright 2010 </p>
      <p> $webSites </p>
    </div>
HERE; 

          /* Close SQL-connection */
          MYSQL_CLOSE();
         
?>

  </body>
</html>

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.