I've getting an error: Parse error: syntax error, unexpected $end on line 64
Can someone see were I type it wrong.
Thanks.. -
<?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æ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ælg lyd</h1>
-
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
-
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
-
Gør du ikke det, bliver diktatet med titelen "<?=$_POST['title']?>" erstattet med dette diktat her!</h3>
-
<?php
-
}
-
?>
-
<form enctype="multipart/form-data" action="save_dict.php" method="post">
-
<input type="hidden" name="MAX_FILE_SIZE" value="500000" />
-
<table border="0">
-
<?php
-
$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;
-
?>
-
<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>
-
5 1552
I've getting an error: Parse error: syntax error, unexpected $end on line 64
Can someone see were I type it wrong.
Thanks.. -
<?php
-
require("database.inc.php");
-
{connectDatabase();
-
You have an open bracket, but I never noticed a closing bracket. That would cause that error.
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... -
<?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æ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ælg lyd</h1>
-
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
-
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
-
Gør du ikke det, bliver diktatet med titelen "<?=$_POST['title']?>" erstattet med dette diktat her!</h3>
-
<?
-
}
-
?>
-
<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;
-
?>
-
<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>
-
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.
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.
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æ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ælg lyd</h1>
<h3 style="color:#CC3333">Pas på! Der findes allerede et diktat med denne titel.<br />
Hvis du er ved at lave et nyt diktat, burde du gå <a href="javascript:history.back()">tilbage</a> og vælge en anden titel.
Gø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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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
|
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...
|
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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
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,...
|
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...
|
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...
|
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,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
| |