Error: $end on line 64

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Goldenlamp
    New Member
    • Jul 2007
    • 6

    Error: $end on line 64

    I've getting an error: Parse error: syntax error, unexpected $end on line 64

    Can someone see were I type it wrong.

    Thanks..

    [code=php]
    <?php
    require("databa se.inc.php");
    {connectDatabas e();
    ?><!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">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>V&aelig; lg lyd til <?=$_POST['title']?></title>
    <link href="style.css " rel="stylesheet " type="text/css" />
    </head>

    <body>
    <? if(file_exists( "text/".$_POST['title'].".txt")) {
    ?>
    <h1>V&aelig;l g lyd</h1>
    <h3 style="color:#C C3333">Pas p&aring;! Der findes allerede et diktat med denne titel.<br />
    Hvis du er ved at lave et nyt diktat, burde du g&aring; <a href="javascrip t:history.back( )">tilbage</a> og v&aelig;lge en anden titel.
    G&oslash;r du ikke det, bliver diktatet med titelen &quot;<?=$_P OST['title']?>&quot; erstattet med dette diktat her!</h3>
    <?php
    }
    ?>
    <form enctype="multip art/form-data" action="save_di ct.php" method="post">
    <input type="hidden" name="MAX_FILE_ SIZE" value="500000" />
    <table border="0">
    <?php
    $result=mysql_q uery("SELECT word FROM repository;");
    while($entry=my sql_fetch_array ($result)) {
    if(! $result)
    exit(mysql_erro r());
    }
    $word_start=0;
    $word_stop=0;
    $open=false;
    $words=array();
    $content=$_POST['content'];
    for($i=0;$i<str len($content);$ i++) {
    if(substr($cont ent,$i,1)=="<" && !$open) {
    $word_start=$i+ 1;
    $open=true;
    }
    elseif(substr($ content,$i,1)== ">" && $open) {
    $word_stop=$i;
    $word=substr($c ontent,$word_st art,$word_stop-$word_start);
    if(!in_array($w ord,$repository )) {
    $words[]=$word;
    ?>
    <tr>
    <td><?=$word? ></td>
    <td><input type="file" name="<?=$word? >" /></td>
    </tr>
    <?
    }
    $open=false;
    }
    }
    ?>
    </table>
    <input type="hidden" name="words" value="<? echo implode(";",$wo rds); ?>" />
    <input type="hidden" name="content" value="<?=$_POS T['content']?>" />
    <input type="hidden" name="title" value="<?=$_POS T['title']?>" />
    <input type="submit" value="Upload &amp; gem" />
    </form>
    </body>
    </html>
    [/CODE]
  • ilearneditonline
    Recognized Expert New Member
    • Jul 2007
    • 130

    #2
    Originally posted by Goldenlamp
    I've getting an error: Parse error: syntax error, unexpected $end on line 64

    Can someone see were I type it wrong.

    Thanks..

    Code:
    <?php
    	require("database.inc.php");
    {connectDatabase();
    You have an open bracket, but I never noticed a closing bracket. That would cause that error.

    Comment

    • Goldenlamp
      New Member
      • Jul 2007
      • 6

      #3
      I've still getting the same error $end on line 66. But I think that the problem isn't in the start of the php. but maby and only maby the end of the PHP.
      Something is not closed properly...


      [code=php]
      <?php
      require("databa se.inc.php");
      {connectDatabas e();
      ?><!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">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>V&aelig; lg lyd til <?=$_POST['title']?></title>
      <link href="style.css " rel="stylesheet " type="text/css" />
      }
      </head>


      <body>
      <? if(file_exists( "text/".$_POST['title'].".txt")) {
      ?>
      <h1>V&aelig;l g lyd</h1>
      <h3 style="color:#C C3333">Pas p&aring;! Der findes allerede et diktat med denne titel.<br />
      Hvis du er ved at lave et nyt diktat, burde du g&aring; <a href="javascrip t:history.back( )">tilbage</a> og v&aelig;lge en anden titel.
      G&oslash;r du ikke det, bliver diktatet med titelen &quot;<?=$_P OST['title']?>&quot; erstattet med dette diktat her!</h3>
      <?
      }
      ?>
      <form enctype="multip art/form-data" action="save_di ct.php" method="post">
      <input type="hidden" name="MAX_FILE_ SIZE" value="500000" />
      <table border="0">
      <?
      $result=mysql_q uery("SELECT word FROM repository;");
      while($entry=my sql_fetch_array ($result)) {
      if(! $result)
      exit(mysql_erro r());
      }
      $word_start=0;
      $word_stop=0;
      $open=false;
      $words=array();
      $content=$_POST['content'];
      for($i=0;$i<str len($content);$ i++) {
      if(substr($cont ent,$i,1)=="<" && !$open) {
      $word_start=$i+ 1;
      $open=true;
      }
      elseif(substr($ content,$i,1)== ">" && $open) {
      $word_stop=$i;
      $word=substr($c ontent,$word_st art,$word_stop-$word_start);
      if(!in_array($w ord,$repository )) {
      $words[]=$word;
      ?>
      <tr>
      <td><?=$word? ></td>
      <td><input type="file" name="<?=$word? >" /></td>
      </tr>
      <?
      }
      $open=false;
      }
      }
      ?>
      </table>
      <input type="hidden" name="words" value="<? echo implode(";",$wo rds); ?>" />
      <input type="hidden" name="content" value="<?=$_POS T['content']?>" />
      <input type="hidden" name="title" value="<?=$_POS T['title']?>" />
      <input type="submit" value="Upload &amp; gem" />
      </form>
      </body>
      </html>
      [/CODE]

      Comment

      • epots9
        Recognized Expert Top Contributor
        • May 2007
        • 1352

        #4
        u still didn't fix the error, u still have a '{' on line 3 where there shouldn't be. Also the error doesn't mean its at the end...kind of....it means that when it finished parsing the document it got to the end of the document and it was looking for something (lets say a '}') since it couldn't find it its complaining, but that '}' could have gone at the top, the point is that the parser we looking for something it didn't find it and its crying.

        Comment

        • ilearneditonline
          Recognized Expert New Member
          • Jul 2007
          • 130

          #5
          Notice that in both errors, it is complaining on the very last line. There is not any PHP code on the last line. Don't be fooled by line numbers with errors. If you forget to close a bracket, it doesn't report it on the line where the open bracket is located, because really the end bracket could be meant to be on the very last line. The error is simply telling you that it parsed everything to the very end and never found the closing bracket.

          Comment

          • Purple
            Recognized Expert Contributor
            • May 2007
            • 404

            #6
            Hi

            Try this:

            [PHP]<?php
            require("databa se.inc.php");
            connectDatabase ();
            ?><!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">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <title>V&aelig; lg lyd til <?=$_POST['title']?></title>
            <link href="style.css " rel="stylesheet " type="text/css" />
            </head>
            <body>
            <?php if(file_exists( "text/".$_POST['title'].".txt"))
            {
            echo '<h1>V&aelig;l g lyd</h1>
            <h3 style="color:#C C3333">Pas p&aring;! Der findes allerede et diktat med denne titel.<br />
            Hvis du er ved at lave et nyt diktat, burde du g&aring; <a href="javascrip t:history.back( )">tilbage</a> og v&aelig;lge en anden titel.
            G&oslash;r du ikke det, bliver diktatet med titelen '.$_POST['title'].' erstattet med dette diktat her!</h3>';
            }
            echo '<form enctype="multip art/form-data" action="save_di ct.php" method="post">
            <input type="hidden" name="MAX_FILE_ SIZE" value="500000" />
            <table border="0">';
            $result=mysql_q uery("SELECT word FROM repository;");
            while($entry=my sql_fetch_array ($result))
            {
            if(! $result) exit(mysql_erro r());
            }
            $word_start=0;
            $word_stop=0;
            $open=false;
            $words=array();
            $content=$_POST['content'];
            for($i=0;$i<str len($content);$ i++)
            {
            if(substr($cont ent,$i,1)=="<" && !$open)
            {
            $word_start=$i+ 1;
            $open=true;
            }
            elseif(substr($ content,$i,1)== ">" && $open)
            {
            $word_stop=$i;
            $word=substr($c ontent,$word_st art,$word_stop-$word_start);
            if(!in_array($w ord,$repository ))
            {
            $words[]=$word;
            echo '<tr><td><'.$wo rd.'</td><td><input type="file" name="'.$word.' " /></td></tr>';
            }
            $open=false;
            }
            }
            ?>
            </table>
            <input type="hidden" name="words" value="<? echo implode(";",$wo rds); ?>" />
            <input type="hidden" name="content" value="<?=$_POS T['content']?>" />
            <input type="hidden" name="title" value="<?=$_POS T['title']?>" />
            <input type="submit" value="Upload & gem" />
            </form>
            </body>
            </html>[/PHP]

            Regards Purple

            Comment

            Working...