Underlig $end-fejl i søgescript
Hej Exp'sJeg har lavet et lille søgescript i php. Den kommer med en underlig bug i linie 110:
Parse error: parse error, unexpected $end in E:\Webserver\TheMaster.dk\res.php on line 114
Dette er linie 114:
</html>
Her er hele scriptet:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<!-- Minus AutoDato -->
<title>TheMaster.dk {<?php echo date(j); echo "/"; echo date(n); echo " - "; echo date(Y); ?>}</title>
<meta name="Generator" content="Stone's WebWriter 4">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<table class="top" width="750" align="left" height="60">
<tr>
<td class="top" valign="middle" width="250">
<img src="/img/top.jpg" alt="TheMaster.dk - may the source be with you...">
</td>
<td class="top" valign="middle" align="right" width="500">
<img src="/img/banner/vport.gif" alt="TheMaster.dk - may the source be with you...">
</td>
</tr>
<tr>
<td width="750" colspan="2">
<table width="750">
<tr>
<td width="120" class="menu" valign="top" align="left">
<font size="2"><b>Menu</b></font>
<br>
<br>
<strong>Nyheder:</strong><br>
<a href="default.php" title="Sidste Nyt">Sidste Nyt</a><br> <a href="nyheder.php?page=arkiv" title="Arkiv">Arkiv</a><br>
<strong>Webhosting:</strong><br>
<a href="produkter.php" title="Produkter">Produkter</a><br> <a href="server.php" title="Lidt om serveren">Lidt om serveren</a><br> <a href="bestil.php" title="Bestil">Bestil</a><br>
<strong>Programmering:</strong><br>
<a href="scripts.php" title="Scripts">Scripts</a><br> <a href="progs.php" title="Programmer">Programmer</a>
<strong>Blandet:</strong>
<a href="kontakt.php" title="Kontakt">Kontakt</a> <br> <a href="partnere.php" title="Partnere">Partnere</a>
</td>
<td width="5">
</td>
<td width="625" valign="top" align="left">
<?php
$soegstr = $_GET["soegstr"];
$conn = mysql_connect("localhost", "***************", "***********");
mysql_select_db("**********");
$result = mysql_query("select * from nyheder");
while ($row = mysql_fetch_array($result)) {
$tekst==$row["tekst"];
if ($soegstr!=$tekst) {
echo "<table cellpadding='0' cellspacing='0' width='625' align='left'><tr><td align='left' valign='top'><font size='2'><strong>Ingen passende referencer:</strong></font></td></tr><tr><td align='left' valign='top' bgcolor='#F1F1F1'>";
echo "Der blev ikke fundet nogle referencer med det ønskede indhold. Prøv igen.<br><br>";
echo "<center><form method='get' action='res.php'>Indtast søgestreng: <input type='text' name='soegstr'><input type='submit' value='Søg'></form></center></td></tr></table><br>";
}
else {
}
mysql_close($conn);
if ($soegstr=="") {
echo "<table cellpadding='0' cellspacing='0' width='625' align='left'><tr><td align='left' valign='top'><font size='2'><strong>Ingen søgestreng!!:</strong></font></td></tr><tr><td align='left' valign='top' bgcolor='#F1F1F1'>";
echo "Du skal huske at skrive noget i tekstfeltet inden du søger. Prøv igen.<br><br>";
echo "<center><form method='get' action='res.php'>Indtast søgestreng: <input type='text' name='soegstr'><input type='submit' value='Søg'><input type='hidden' name='str' value='soegstr'></form></center></td></tr></table><br>";
}
else {
echo "<b>Søgeresultat:</b>";
$soegstr = $_GET["soegstr"];
$conn = mysql_connect("localhost", "**************", "**************")
mysql_select_db("********");
$result = mysql_query("select * from nyheder where tekst like '%$soegstr%' or titel like '%$soegstr%'");
while ($row = mysql_fetch_array($result)) {
echo "<table width='625' class='nyheder'><tr><td align='left' valign='top' width='525'><li><i>";
echo $row['titel'];
echo "</i></li></td><td align='right' valign='top' width='100'>";
echo $row['dag'];
echo "/";
echo $row['maaned'];
echo " - ";
echo $row['aar'];
echo "</td></tr><tr><td align='left' valign='top' width='625' colspan='2'>";
echo $row['tekst'];
echo "</td></tr><tr><td colspan='2' align='right' valign='top' width='625'><font size='1'><a href='nyheder.asp?page=laes&ID=";
echo $row['id'];
echo "'>Læs mere</a></font></td></tr></table><br>";
mysql_close($conn);
}
?>
</td>
</tr>
</table>
</body>
</html>
Er der nogle der kan se fejlen??
//themaster
