Why do I get "Parse error: syntax error..."?

by 7 replies
8
Hi, hopefully someone can help me solve the issue I am having with a newsite just uploaded to hostgator (no problems with other sites of mine hosted there).
Thanks to anyone willing to help!
Vince

Parse error
: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/xxxxxxx/public_html/mysite.com/index.php on line 1

The doctype is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
#programming #doctype #parse error #parse error syntax error #syntax error
  • Hi,

    this error is due to you having a mistake within your PHP code, it has nothing to do with your doc type as the error is on the PHP code which is serverside and processed before the XHTML is displayed.

    I usually find these errors are due to a mistaken quote or lack of a ;

    if you wish to send me your php code or post the code here I could help you some more.

    Otherwise take a look over your php code and check everything is correct.
  • You sure you don't have <?php above that line?

    It looks like the standard PHP error
    • [1] reply
    • Here's the only php call I use in the page:

      <head>
      <title>
      <?php include './somefile.php';
      echo "$customtitle";
      ?></title>

      Edit: Tried to change './somefile.php'; in to 'somefile.php'; since it is in the root directory but it doesn't work either...
  • Is $customtitle defined in somefile.php
    and take the quotes off the echo.

    echo $customtitle;
    • [1] reply
    • Thank you, I'll give it a try.
      • [1] reply

Next Topics on Trending Feed