Annoying parse error!

Discussion in 'PHP' started by X-man29, Nov 10, 2009.

  1. #1
    I keep on getting Parse error: syntax error, unexpected T_VARIABLE in /home/societies/ppe/pubwww/index.php on line 1

    The code is as follows:



    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html

    xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><?phpglobal $db;$db = mysql_connect("localhost", "ppe_admin", "aw3421");mysql_select_db

    ("ppe",$db);include("main.php");function doMenuItem($url, $title){ echo "<a class=\"titlelink\" href=\"$url\">$title</a>\n";}?><head><link rel="shortcut

    icon" href="http://www.umsu.manchester.ac.uk/ppe/favicon.ico" ><title>Politics Philosophy and Economics Society</title><meta http-equiv="content-

    type" content="text/html; charset=iso-8859-1" /><meta name="description" content="Your website description goes here" /><meta name="keywords"

    content="your,keywords,goes,here" /><link rel="stylesheet" href="ppe.css" type="text/css" media="screen,projection" /></head><body><div

    id="container" ><div id="header"><h1>Politics Philosophy and Economics Society </h1><h2><em>&quot;Concordia res parvae crescent&quot;</em> -

    Work together to accomplish more</h2></div><div id="navigation"><ul><li class="selected"><a href="index.php">HOME</a></li><li><a

    href="society/index.php">THE SOCIETY</a></li><li><a href="mentoring/index.php">MENTORING</a></li><li><a href="course/index.php">THE

    COURSE</a></li><li><a href="social/index.php">SOCIAL</a></li><li><a href="links.html">LINKS</a></li></ul></div><div id="content"><h2>Welcome to

    the brand new PPE Society website </h2>
    <p>
     
    X-man29, Nov 10, 2009 IP
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Can u post ur codes in proper lining ??
     
    Bohra, Nov 10, 2009 IP
  3. Altari

    Altari Peon

    Messages:
    188
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Two things. If the spacing is all intact

    <?phpglobal $db;$db = mysql_connect("localhost", "ppe_admin", "aw3421");
    should be
    <?php global $db;$db = mysql_connect("localhost", "ppe_admin", "aw3421");

    Second. Please change your MySQL password ASAP.
     
    Altari, Nov 10, 2009 IP
  4. X-man29

    X-man29 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    (password changed)

    I made the edit you suggested, but I still get the same message. Could anything else be the problem?
     
    X-man29, Nov 11, 2009 IP
  5. n3r0x

    n3r0x Well-Known Member

    Messages:
    257
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    120
    #5
    you should have a space here

    <?phpglobal $db;$db = mysql_connect("localhost", "ppe_admin", "aw3421");
    PHP:

    <?php 
    global $db;$db = mysql_connect("********", "***", "***");
    ?>
    
    PHP:
    php and global should not stick together..:p
     
    n3r0x, Nov 11, 2009 IP
  6. gabibeowulfx

    gabibeowulfx Active Member

    Messages:
    211
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    63
    #6
    It is very hard to follow your code mate. The problem is that you have a missing ";" or a missing "}"

    It may very well be in the main.php file. I suggest you start commenting all your PHP code by // and than restore them block by block and figure out where the problem is
     
    gabibeowulfx, Nov 11, 2009 IP
  7. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Can you copy and paste the file to a text file and link to it? Maybe that would be helpful. Changing the passwords first of course.
     
    theapparatus, Nov 12, 2009 IP