problemmer med søgemaskine
Min søgemaskine viser det, jeg søger rigtig nok...men jeg har lavet links til hvert søge resultat..Det virker kun hvis det er en overskrift...Hvis det er en undermenu så hvis den bare hvis skærm, her er koden:
<?php require_once('Connections/CMS.php'); ?>
<?php
$colname_rsResultat = "1";
if (isset($_GET['Search'])) {
$colname_rsResultat = (get_magic_quotes_gpc()) ? $_GET['Search'] : addslashes($_GET['Search']);
}
mysql_select_db($database_CMS, $CMS);
$query_rsResultat = sprintf("SELECT id, mainid, overskrift FROM sideindhold WHERE tekst1 LIKE '%%%s%%' OR tekst2 LIKE '%%%s%%' OR overskrift LIKE '%%%s%%'", $colname_rsResultat,$colname_rsResultat,$colname_rsResultat);
$rsResultat = mysql_query($query_rsResultat, $CMS) or die(mysql_error());
$row_rsResultat = mysql_fetch_assoc($rsResultat);
$totalRows_rsResultat = mysql_num_rows($rsResultat);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LBB</title>
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
font-size: 16px;
font-weight: bold;
font-style: italic;
}
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" class="top"><div align="center"><img src="IMG/Budstikken_banner.jpg" width="550" height="115"><img src="IMG/LBB-komma.gif" width="167" height="115"></div></td>
</tr>
<tr>
<td width="17%" class="top1"> </td>
<td width="83%" class="top1 "><a href="index.php?id=1&mainid=1">Topmenu 1 </a>|<a href="index.php?id=2&mainid=2"> Topmenu 2 </a>|<a href="index.php?id=3&mainid=3"> Topmenu 3 </a>|<a href="index.php?id=4&mainid=4"> Topmenu 4 </a>|<a href="index.php?id=5&mainid=5"> Topmenu 5 </a>| </td>
</tr>
<tr>
<td class="Left"><p> </p>
<p></td>
<td class="none"><form name="form1" method="get" action="Resultat.php">
<table width="200" border="0" align="right" cellpadding="2" cellspacing="0">
<tr>
<td><input name="Search" type="text" id="Search"></td>
<td><input name="Søg" type="submit" id="Søg" value="Søg"></td>
</tr>
</table>
</form>
<p> </p>
<table width="950" border="0" cellspacing="0" cellpadding="2">
<tr>
<td><h1 class="style1">Resultater:</h1>
<hr>
</tr>
<?php do { ?>
<tr>
<td><a href="index.php?id=<?php echo $row_rsResultat['id']; ?><?php if ($row_rsResultat['mainid'] <> null) echo "&mainid="+$row_rsResultat['mainid']; ?>"><?php echo $row_rsResultat['overskrift']; ?></a></td>
</tr>
<?php } while ($row_rsResultat = mysql_fetch_assoc($rsResultat)); ?>
</table>
<table width="950" border="0" cellspacing="0" cellpadding="2">
<?php if ($totalRows_rsResultat == 0) { // Show if recordset empty ?>
<tr>
<td>Søgning gav desværre ikke nogen resultater. </td>
</tr>
<?php } // Show if recordset empty ?>
</table> <p align="left"> </p>
<table width="90%" border="0" cellspacing="0" cellpadding="5">
<tr>
</table> <p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($rsResultat);
?>
