8 Replies Latest reply on Oct 2, 2007 12:14 PM by Newsgroup_User

    Parse error: syntax error?

    LDoneyNeel
      Hi all -- my org's web site won't load -- the browser says this:

      Parse error: syntax error, unexpected $end in /var/htdocs/www.akcf.org/index.php on line 87

      So I realize the LINE 87 is referring to that line in Dreamweaver, but since I do not know code well at all, I don't know what's wrong. All it is in Line 87 is this: ?>

      Can anyone give me some guidance on this please?

      Thanks much!
        • 1. Re: Parse error: syntax error?
          Level 7
          .oO(LDoneyNeel)

          >Hi all -- my org's web site won't load -- the browser says this:
          >
          > Parse error: syntax error, unexpected $end in
          >/var/htdocs/www.akcf.org/index.php on line 87
          >
          > So I realize the LINE 87 is referring to that line in Dreamweaver, but since I
          >do not know code well at all, I don't know what's wrong. All it is in Line 87
          >is this: ?>
          >
          > Can anyone give me some guidance on this please?

          The error is somewhere in the lines before line 87. Please post them.

          Micha
          • 2. Re: Parse error: syntax error?
            LDoneyNeel Level 1
            Thanks Michael for the fast reply! So the error is BEFORE Line 87? I would think it's right IN Line 87 -- thanks! MY liens are 85-87 below:

            <?
            include_once ("_header/footer.php");
            ?>

            It's referring of course to our footer we have on our home page.
            • 3. Re: Parse error: syntax error?
              Level 7
              What the error means is that some process was opened in lines 1 - 86, and
              when it reached line 87 that closes the PHP scripting, that process had not
              been closed, so, the error is the unexpected $end at line 87. Who knows
              what line opened the process - we sure don't without seeing ALL the lines
              (including those in the includes).

              --
              Murray --- ICQ 71997575
              Adobe Community Expert
              (If you *MUST* email me, don't LAUGH when you do so!)
              ==================
              http://www.dreamweavermx-templates.com - Template Triage!
              http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
              http://www.dwfaq.com - DW FAQs, Tutorials & Resources
              http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
              ==================


              "LDoneyNeel" <webforumsuser@macromedia.com> wrote in message
              news:fdtu86$1lu$1@forums.macromedia.com...
              > Thanks Michael for the fast reply! So the error is BEFORE Line 87? I
              > would
              > think it's right IN Line 87 -- thanks! MY liens are 85-87 below:
              >
              > <?
              > include_once ("_header/footer.php");
              > ?>
              >
              > It's referring of course to our footer we have on our home page.
              >


              • 4. Re: Parse error: syntax error?
                Level 7
                .oO(LDoneyNeel)

                >Thanks Michael for the fast reply! So the error is BEFORE Line 87?

                Probably. That's part of the confusion. The position where the parser
                starts complaining is not always the real source of the problem. The
                parser just follows its rules. It's quite possible that at some point
                the parser runs into a problem, even if all statements before were
                syntactically correct.

                Maybe another example helps: You're driving down a road. At some turnout
                you have to decide whether to drive to the left or right. You take the
                right. You're driving further down the road. All seems to be OK ("syn-
                tactically correct") for the next kilometers. But suddenly you get to a
                dead end ("parse error")! Now where's the reason for that problem? It's
                not the current location, but the decision you made some kilometers ago!

                The same thing often happens with parse errors. By just following its
                rules, the parser might run into a dead-end road, which is the point
                where the error message is thrown. But the real reason could be
                somewhere behind.

                >I would
                >think it's right IN Line 87 -- thanks! MY liens are 85-87 below:
                >
                > <?
                > include_once ("_header/footer.php");
                > ?>

                This doesn't help much. Probably the error is in the footer.php file.
                The given error message could be a hint for a missing brace for example.

                Micha
                • 5. Re: Parse error: syntax error?
                  Level 7
                  LDoneyNeel wrote:
                  > Parse error: syntax error, unexpected $end in

                  Unexpected $end means that it has reached the end of the script without
                  finding something that should have been there - usually a closing brace
                  somewhere earlier in the script.

                  --
                  David Powers, Adobe Community Expert
                  Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
                  Author, "PHP Solutions" (friends of ED)
                  http://foundationphp.com/
                  • 6. Parse error: syntax error?
                    LDoneyNeel Level 1
                    Thanks Michael -- our example helped me understand it a lot. Ok, so I have to post all my lines? I'd rather email them instead, if that is ok......?

                    EDIT -- forget it, here's the entire page :-)

                    <?
                    $g_strPageName="Home";
                    $g_menu_homepage=true;
                    include_once("_header/header.php");
                    ?>

                    <table width="100%" border="0" cellpadding="0" cellspacing="0">

                    <tr>
                    <td colspan="3" valign="top">
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                    <td align="left"><div class="home_news_dir">
                    <?
                    if(empty($_GET['story']))$i_randomNum = rand(1,5);
                    else $i_randomNum = $_GET['story'];
                    switch ($i_randomNum){

                    case 1:
                    include("_pages/story/rotating_lead_story4a.php");
                    break;


                    case 2:
                    include("_pages/story/rotating_lead_story9a-SCS.php");
                    break;

                    case 3:
                    include("_pages/story/rotating_lead_story3a-EF.php");
                    break;


                    case 4:
                    include("_pages/story/rotating_lead_story2a-ISER_report.php");
                    break;

                    case 5:
                    include("_pages/story/rotating_lead_story5a.php");
                    break;


                    ?>
                    </div></td>
                    </tr>
                    </table>
                    <table width="99%" border="0" cellpadding="0" cellspacing="0">
                    <tr class="dots"><td> </td></tr>
                    </table> </td>

                    <td rowspan="2" valign="top"><img src="/_images/Homepage/homepage_sidebar.jpg" border="0"></td>
                    </tr>

                    <tr>
                    <td valign="top" ><div class="home_news">
                    <div class="in_the_news">
                    <img src="/_images/Homepage/in_the_news_header.jpg" width="132" height="46" border="0"><br>
                    <img src="/_images/Homepage/auklet-small.jpg" alt="Oiled Crested Auklet from North Skan Bay photo by U.S. Fish and Wildlife Service" width="132" height="64" border="0">
                    <br>
                    Explore conservation issues in Alaska--or check out events, deadlines, and job opportunities in <a href="_pages/events_amp_publications/whatsup.php">What's Up!</a><br>
                    <a href="_pages/story/In_the-news.php"><img align="right" src="/_images/_layout/btn_more.jpg" border="0"></a></div>
                    </div></td>

                    <td valign="top" ><div class="home_news"><div class="making_a_difference">
                    <img src="/_images/Homepage/making_a_difference_header.jpg" width="132" height="46" border="0" align="top"><br>
                    <img src="_images/Homepage/NY.JPG" alt="Students working on Exxon Mobil case, photo by Maryanne Fisher" width="133" height="66" /><br>
                    For these New York students, there's no greater cause than fighting for Alaska.
                    <br>
                    <br>
                    <a href="_pages/story/box2-making_a_difference.php" target="_self">
                    <img align="right" src="/_images/_layout/btn_more.jpg" border="0"></a></div>
                    </div></td>

                    <td valign="top" ><div class="home_news"><div class="acf_news">
                    <img src="/_images/Homepage/acf_news_header.jpg" width="132" height="46" border="0" align="top"><br>
                    <img src="/_images/Homepage/ACFNews.jpg" alt="Jimmy Carter, Jay Hammond, and Ginny Wood at ANILCA celebration (Photo by Clark Mischler)" width="133" height="66" border="0"><br>
                    Get inside ACF and see what's happening today.
                    <br>
                    <br>
                    <a href="_pages/story/box3-ACFnews.php" target="_self">
                    <img align="right" src="/_images/_layout/btn_more.jpg" border="0"></a>
                    </div>
                    </div></td>
                    </tr>
                    </table>
                    <?
                    include_once ("_header/footer.php");
                    ?>



                    Did ya get all that? I CAN tell you that I took out Case 6 and Case 7 yesterday morning.....so that must be what screwed me up!
                    • 7. Re: Parse error: syntax error?
                      Level 7
                      If you email them, then only the person receiving them can help you
                      further....

                      --
                      Murray --- ICQ 71997575
                      Adobe Community Expert
                      (If you *MUST* email me, don't LAUGH when you do so!)
                      ==================
                      http://www.dreamweavermx-templates.com - Template Triage!
                      http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
                      http://www.dwfaq.com - DW FAQs, Tutorials & Resources
                      http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
                      ==================


                      "LDoneyNeel" <webforumsuser@macromedia.com> wrote in message
                      news:fdu517$8qp$1@forums.macromedia.com...
                      > Thanks Michael -- our example helped me understand it a lot. Ok, so I
                      > have to post all my lines? I'd rather email them instead, if that is
                      > ok......?


                      • 8. Re: Parse error: syntax error?
                        Level 7
                        .oO(LDoneyNeel)

                        >Thanks Michael -- our example helped me understand it a lot. Ok, so I
                        >have to post all my lines? I'd rather email them instead, if that is
                        >ok......?

                        You can mail it, no problem.

                        Micha