Submit Your Article Forum Rules

Results 1 to 8 of 8

Thread: Help please - getting Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRIN

  1. #1

    Question Help please - getting Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRIN

    Hi! I'm trying to build a site for a client and I normally can figure out how to get the PHP pages to work properly but for some reason, I'm having lots of problems getting http://74.54.176.178/~rickett/ (I'm still waiting for her registrar to update DNS records) to give me anything other than pains and problems getting a result other than the above error.
    The code I'm using on the page:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
    <link href="/style.css" media="screen" rel="stylesheet" type="text/css" />

    <head>
    <meta http-equiv="Content-Language" content="en-us" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>The Elfant Rickett Law Firm</title>
    </head>

    <body style="background-color: #330B38">

    <br />
    <table style="width: 80%" cellspacing="4" cellpadding="6" align="center" class="style1">
    <tr>
    <td colspan="2" align="center"><?php include "header.htm";?>
    </td>
    </tr>
    <tr class="links" valign="top">
    <td style="width: 150px"><br />
    <br /><?php include "nav.htm";?>
    </td>
    <td><?php include "main.htm";?>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="center" class="footer"><?php include "footer.htm";?></td>
    </tr>
    </table>
    <br />
    </body>

    </html>

    Any help you can provide for me would be GREATLY appreciated!

    Thanks so much,
    Jennifer
    Last edited by ccnj; 08-09-2012 at 04:17 PM. Reason: getting rid of smilies that somehow showed up

  2. #2
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,793
    The HTML above doesn't show enough. We need to see the modules. You might look for incomplete string concatenations. PHP is seeing unexpected tokens such as a " with no leading . or possibly an unescaped " within a quoted expression.

    Eg. "<a class="link" href="somepage.html">Some page</a>"

    should look like,

    "<a class=\"link\" href=\"somepage.html\">Some page</a>".

    Or possibly something like this,

    "<a class=\"link\" href=\"" . $somepage"\">Some page</a>"

    Notice the missing dot after $somepage ?

  3. #3
    Thank you for your reply. I have to say I am a bit confused by it though -- I am only using PHP to call other HTML pages, no programming otherwise. Usually all I need to do is have the include tag and everything works. Now, I can't. BTW, I had to change the link on the site above to http://localbizmkt.com/elfantrickettlawyers/index.php. For your reference, the page is supposed to look like http://localbizmkt.com/elfantrickettlawyers/mockup.htm only broken into tables for the PHP include.

    Thanks!
    Jennifer
    Last edited by weegillis; 08-10-2012 at 03:59 PM. Reason: duplicate in the update

  4. #4
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,793
    So what you're saying is that there is no PHP in the modules? This is the only PHP? Then I guess we have to look for something simple in this page. Try entering a space after the ';' just before '?>', or even just removing the semi-colon (last statement doesn't need one, afaik). I would still leave a space before the closing tag.

  5. #5
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    760
    The error can easily be in one of the included files. Since you haven't shown these, it's hard to tell what's going on.
    Dynamic Software Development
    www.activeminds.ca

  6. #6
    I don't know why, but after I took out header.htm and put the image onto the actual php page instead of including it, I got the page to show. Makes NO sense to me, but thank you so much for your help!

    Jennifer

  7. #7
    Administrator weegillis's Avatar
    Join Date
    Oct 2003
    Posts
    5,793
    Glad you got it fixed. @ccnj, shall we close this thread, now that nothing remains to be discussed? We can re-open it later if you have more to add.
    Last edited by weegillis; 08-12-2012 at 07:20 PM. Reason: lately->later

  8. #8
    WebProWorld MVP DaveSawers's Avatar
    Join Date
    Dec 2006
    Location
    Lunenburg, Nova Scotia, Canada
    Posts
    760
    Quote Originally Posted by ccnj View Post
    I don't know why, but after I took out header.htm and put the image onto the actual php page instead of including it, I got the page to show. Makes NO sense to me, but thank you so much for your help!

    Jennifer
    Because the error was in header.hm.
    Dynamic Software Development
    www.activeminds.ca

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •