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

by wincex
7 replies
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">
#doctype #parse error #parse error syntax error #syntax error
  • Profile picture of the author Zido
    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.
    {{ DiscussionBoard.errors[1217129].message }}
  • Profile picture of the author mpruben
    You sure you don't have <?php above that line?

    It looks like the standard PHP error
    {{ DiscussionBoard.errors[1217135].message }}
    • Profile picture of the author wincex
      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...
      Signature

      Murphy's law:"It is impossible to make anything foolproof because fools are so ingenious"

      {{ DiscussionBoard.errors[1217158].message }}
  • Profile picture of the author KirkMcD
    Is $customtitle defined in somefile.php
    and take the quotes off the echo.

    echo $customtitle;
    {{ DiscussionBoard.errors[1217261].message }}
    • Profile picture of the author wincex
      Originally Posted by KirkMcD View Post

      Is defined in somefile.php
      and take the quotes off the echo.

      echo ;
      Thank you, I'll give it a try.
      Signature

      Murphy's law:"It is impossible to make anything foolproof because fools are so ingenious"

      {{ DiscussionBoard.errors[1217444].message }}
      • Profile picture of the author wincex
        it doesn't work....:confused:
        Signature

        Murphy's law:"It is impossible to make anything foolproof because fools are so ingenious"

        {{ DiscussionBoard.errors[1217472].message }}
        • Profile picture of the author wincex
          Re-uploaded the files in binary mode - it works great!
          The guilty ==>Filezilla: was set to auto...
          Signature

          Murphy's law:"It is impossible to make anything foolproof because fools are so ingenious"

          {{ DiscussionBoard.errors[1217851].message }}

Trending Topics