473,466 Members | 1,307 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Error: $end on line 64

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

Can someone see were I type it wrong.

Thanks..

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     require("database.inc.php");
  3. {connectDatabase();
  4. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  8. <title>V&aelig;lg lyd til <?=$_POST['title']?></title>
  9. <link href="style.css" rel="stylesheet" type="text/css" />
  10. </head>
  11.  
  12. <body>
  13. <? if(file_exists("text/".$_POST['title'].".txt")) {
  14. ?>
  15. <h1>V&aelig;lg lyd</h1>
  16. <h3 style="color:#CC3333">Pas p&aring;! Der findes allerede et diktat med denne titel.<br />
  17. Hvis du er ved at lave et nyt diktat, burde du g&aring; <a href="javascript:history.back()">tilbage</a> og v&aelig;lge en anden titel.
  18. G&oslash;r du ikke det, bliver diktatet med titelen &quot;<?=$_POST['title']?>&quot; erstattet med dette diktat her!</h3>
  19. <?php
  20. }
  21. ?>
  22. <form enctype="multipart/form-data" action="save_dict.php" method="post">
  23. <input type="hidden" name="MAX_FILE_SIZE" value="500000" />
  24. <table border="0">
  25. <?php
  26.     $result=mysql_query("SELECT word FROM repository;");
  27.     while($entry=mysql_fetch_array($result)) {
  28.       if(! $result)
  29.           exit(mysql_error());
  30.     }
  31.     $word_start=0;
  32.     $word_stop=0;
  33.     $open=false;
  34.     $words=array();
  35.     $content=$_POST['content'];
  36.     for($i=0;$i<strlen($content);$i++) {
  37.         if(substr($content,$i,1)=="<" && !$open) {
  38.             $word_start=$i+1;
  39.             $open=true;
  40.         }
  41.         elseif(substr($content,$i,1)==">" && $open) {
  42.             $word_stop=$i;
  43.             $word=substr($content,$word_start,$word_stop-$word_start);
  44.             if(!in_array($word,$repository)) {
  45.                 $words[]=$word;
  46.                 ?>
  47.                 <tr>
  48.                     <td><?=$word?></td>
  49.                     <td><input type="file" name="<?=$word?>" /></td>
  50.                 </tr>
  51.                 <?
  52.             }
  53.             $open=false;
  54.         }
  55.     }
  56. ?>
  57. </table>
  58. <input type="hidden" name="words" value="<? echo implode(";",$words); ?>" />
  59. <input type="hidden" name="content" value="<?=$_POST['content']?>" />
  60. <input type="hidden" name="title" value="<?=$_POST['title']?>" />
  61. <input type="submit" value="Upload &amp; gem" />
  62. </form>
  63. </body>
  64. </html>
  65.  
Jul 12 '07 #1
5 1552
ilearneditonline
130 Recognized Expert New Member
I've getting an error: Parse error: syntax error, unexpected $end on line 64

Can someone see were I type it wrong.

Thanks..

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     require("database.inc.php");
  3. {connectDatabase();
  4.  
You have an open bracket, but I never noticed a closing bracket. That would cause that error.
Jul 12 '07 #2
Goldenlamp
6 New Member
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...


Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     require("database.inc.php");
  3. {connectDatabase();
  4. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head>
  7. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  8. <title>V&aelig;lg lyd til <?=$_POST['title']?></title>
  9. <link href="style.css" rel="stylesheet" type="text/css" />
  10. }
  11. </head>
  12.  
  13.  
  14. <body>
  15. <? if(file_exists("text/".$_POST['title'].".txt")) {
  16. ?>
  17. <h1>V&aelig;lg lyd</h1>
  18. <h3 style="color:#CC3333">Pas p&aring;! Der findes allerede et diktat med denne titel.<br />
  19. Hvis du er ved at lave et nyt diktat, burde du g&aring; <a href="javascript:history.back()">tilbage</a> og v&aelig;lge en anden titel.
  20. G&oslash;r du ikke det, bliver diktatet med titelen &quot;<?=$_POST['title']?>&quot; erstattet med dette diktat her!</h3>
  21. <?
  22. }
  23. ?>
  24. <form enctype="multipart/form-data" action="save_dict.php" method="post">
  25. <input type="hidden" name="MAX_FILE_SIZE" value="500000" />
  26. <table border="0">
  27. <?
  28.     $result=mysql_query("SELECT word FROM repository;");
  29.     while($entry=mysql_fetch_array($result)) {
  30.       if(! $result)
  31.           exit(mysql_error());
  32.     }
  33.     $word_start=0;
  34.     $word_stop=0;
  35.     $open=false;
  36.     $words=array();
  37.     $content=$_POST['content'];
  38.     for($i=0;$i<strlen($content);$i++) {
  39.         if(substr($content,$i,1)=="<" && !$open) {
  40.             $word_start=$i+1;
  41.             $open=true;
  42.         }
  43.         elseif(substr($content,$i,1)==">" && $open) {
  44.             $word_stop=$i;
  45.             $word=substr($content,$word_start,$word_stop-$word_start);
  46.             if(!in_array($word,$repository)) {
  47.                 $words[]=$word;
  48.                 ?>
  49.                 <tr>
  50.                     <td><?=$word?></td>
  51.                     <td><input type="file" name="<?=$word?>" /></td>
  52.                 </tr>
  53.                 <?
  54.             }
  55.             $open=false;
  56.         }
  57.     }
  58. ?>
  59. </table>
  60. <input type="hidden" name="words" value="<? echo implode(";",$words); ?>" />
  61. <input type="hidden" name="content" value="<?=$_POST['content']?>" />
  62. <input type="hidden" name="title" value="<?=$_POST['title']?>" />
  63. <input type="submit" value="Upload &amp; gem" />
  64. </form>
  65. </body>
  66. </html>
  67.  
Jul 12 '07 #3
epots9
1,351 Recognized Expert Top Contributor
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.
Jul 12 '07 #4
ilearneditonline
130 Recognized Expert New Member
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.
Jul 12 '07 #5
Purple
404 Recognized Expert Contributor
Hi

Try this:

[PHP]<?php
require("database.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;lg lyd</h1>
<h3 style="color:#CC3333">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="javascript: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="multipart/form-data" action="save_dict.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
<table border="0">';
$result=mysql_query("SELECT word FROM repository;");
while($entry=mysql_fetch_array($result))
{
if(! $result) exit(mysql_error());
}
$word_start=0;
$word_stop=0;
$open=false;
$words=array();
$content=$_POST['content'];
for($i=0;$i<strlen($content);$i++)
{
if(substr($content,$i,1)=="<" && !$open)
{
$word_start=$i+1;
$open=true;
}
elseif(substr($content,$i,1)==">" && $open)
{
$word_stop=$i;
$word=substr($content,$word_start,$word_stop-$word_start);
if(!in_array($word,$repository))
{
$words[]=$word;
echo '<tr><td><'.$word.'</td><td><input type="file" name="'.$word.'" /></td></tr>';
}
$open=false;
}
}
?>
</table>
<input type="hidden" name="words" value="<? echo implode(";",$words); ?>" />
<input type="hidden" name="content" value="<?=$_POST['content']?>" />
<input type="hidden" name="title" value="<?=$_POST['title']?>" />
<input type="submit" value="Upload & gem" />
</form>
</body>
</html>[/PHP]

Regards Purple
Jul 12 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike Fisher | last post by:
I'm seeing an error when I try to run/debug a web service. Although it doesn't happen every time, it does occur more than half of the times I hit F5. It appears to be returned by the the JIT...
3
by: James Proctor | last post by:
Hi there, im brand new to ASP. Ive done loads of VB coding and one of my clients is intrested in a web based application, so im trying to play on and learn it a tad. However im comming across lots...
13
by: deko | last post by:
I use this convention frequently: Exit_Here: Exit Sub HandleErr: Select Case Err.Number Case 3163 Resume Next Case 3376 Resume Next
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
5
by: Raterus | last post by:
I'm just throwing this error out for my sanity, I've seen posts about this, but never solutions. I'm using VS.NET 2003, Framework 1.1, and I'm getting a random error about every 1 out of 10 times...
2
by: VB Programmer | last post by:
I created a ASP.NET app locally and it works great. Uploaded it to my server and I get this error when trying to view a page. Any ideas? Server Error in '/earlyalert3' Application....
1
by: James Proctor | last post by:
Hi there, im brand new to ASP. Ive done loads of VB coding and one of my clients is intrested in a web based application, so im trying to play on and learn it a tad. However im comming across lots...
3
by: dancer | last post by:
I am using Framework 1.1.4322. Who can tell me why I'm getting this error? My code follows Compilation Error Description: An error occurred during the compilation of a resource required to...
0
by: poojamangal | last post by:
I want to upload images or pdf files. but i m unable to do so. i got error. please help me to sort it out.. my code is: <% 'on error resume next Class FreeASPUpload Public UploadedFiles...
2
by: kevinr | last post by:
Hi, I am brand new to VB, and I am trying to deploy Office 2007 on my network here at work. We used part of this script to do another deployment, and I have taken pieces and tried to edit for this...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.