jeg har en fil der hedder search.php, og den includer bare autoriser.inc, men så vidt jeg kan indeholder search ikke noget i relevans herfor, men her har du den:
<?php
require ('../include/autoriser.inc');
require ('../include/forbind.inc');
#############################################################
#### Hvis der er submittet nogle data, sa lav modtager siden
##############################################################
if (isset($go) OR isset($offset))
{
// next determine if offset has been passed to script, if not use 0
if (empty($offset))
$offset=0;
$limit=20;
print ("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\"
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd\">\n<html>\n<head>\n<title>Search results</title>\n<meta name=\"generator\" content=\"BBEdit 6.5.2\">\n<link rel=\"stylesheet\" href=\"/css/content_style.css\" type=\"text/css\">\n</head>\n<body bgcolor=\"#f8efe0\">\n<table align=\"center\" width=\"500\"><tr><td valign=\"top\"><table align=\"center\" width=\"250\">");
################################################
#### Lav en sogestreng udfra submit oplysningerne
################################################
$query = "SELECT a_index, a_name, a_national from TB_author";
if (empty($search_area) OR $search_area=='ALL')
//$search_area = "a_name OR a_title OR a_national OR a_year";
$query = $query ." WHERE a_name LIKE '%$search_string%' OR a_title LIKE '%$search_string%' OR a_national LIKE '%$search_string%' OR a_year LIKE '$search_string'";
if (isset($search_string) AND $search_area!='ALL')
$query = $query ." WHERE $search_area LIKE '%$search_string%'";
// rows to return
$antal=mysql_query($query);
$numrows=mysql_num_rows($antal);
#############################################################################
####saet limit saetning pa
#############################################################################
$query_limit = $query ." ORDER BY a_name LIMIT $offset,$limit ";
// get results
$result=mysql_query($query_limit);
// now you can display the results returned
$t = 0;
while ($row = mysql_fetch_array($result))
{
$a_name=htmlentities($row[a_name]);
print ("<tr>\n<td><a href=\"view_author.php?id=$row[a_index]&offset=$offset&search_area=$search_area&search_string=$search_string\">$a_name, $row[a_national]</a>\n</td>\n</tr>\n");
$t++;
if ($t=='10')
print"</table></td><td valign=\"top\"><table align=\"center\" width=\"250\">";
}
print "</table><tr><td colspan=\"2\">";
print "<table border=\"0\" class=\"box\" align=\"center\"><tr><td>\"$numrows\" records found matching your search criteria: \"$search_string\" </td></tr></table>";
print "<table width=\"500\"><tr>";
// next we need to do the links to other results
if ($offset!=0) { // bypass PREV link if offset is 0
$prevoffset=$offset-8;
print "<td width=\"166\"><a href=\"$PHP_SELF?offset=$prevoffset&search_area=$search_area&search_string=$search_string\"><<Previous</a></td>";
}
// calculate number of pages needing links
$pages=intval($numrows/$limit);
// $pages now contains int of pages needed unless there is a remainder from division
if ($numrows%$limit) {
// has remainder so add one page
$pages++;
}
//for ($i=1;$i<=$pages;$i++) { // loop thru
//$newoffset=$limit*($i-1);
//print ("<a href=\"$PHP_SELF?offset=$newoffset&search_area=$search_area&search_string=$search_string\">$i</a> \n");
//}
print "<td align=\"center\" width=\"166\"><a href=\"$PHP_SELF\"><strong>Search page</strong></a></td>";
// check to see if last page
//print "offset er: $ofsset, limit er: $limit, antal er $numrows";
$total = $offset+$limit;
if ($total < $numrows)
{
// not last page so give NEXT link
$newoffset=$offset+$limit;
print "<td align=\"right\" width=\"166\"><a href=\"$PHP_SELF?offset=$newoffset&search_area=$search_area&search_string=$search_string\">Next>></a></td>";
}
if (mysql_num_rows($result)=='0')
print "Sorry, no matches to your search pattern";
print "</tr></table></td></tr></table>";
exit;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"><html>
<head>
<title>Search the database</title>
<meta name="generator" content="BBEdit 6.5.2">
<link rel="stylesheet" href="/css/content_style.css" type="text/css">
</head>
<body bgcolor="#f8efe0">
<form name="form1" method="post" action="<? echo $PHP_SELF; ?>">
<table align="center" border="0" width="500" cellspacing="4" cellpadding="4">
<tr>
<td align="center" colspan="5">SEARCH THE DATABASE
<input type="hidden" name="go" value="hitit">
</td>
</tr>
<tr align="center" valign="top">
<td>Search for </td>
<td>
<input type="text" name="search_string" size="15">
</td>
<td>in </td>
<td>
<select name="search_area">
<option value="ALL" selected>All database</option>
<option value="a_name">Name</option>
<option value="a_title">Profession</option>
<option value="a_national">Nationality</option>
<option value="a_year">Participation year</option>
</select>
</td>
<td>
<input type="image" name="Submit" src="../gfx/search.gif">
</td>
</tr>
<tr>
<td align="left" colspan="5">
<ul>
<p> </p>
<p><b>NOTE:</b> </p>
<li>You need only type part of the word you are searching for.</li>
<li>For a complete listing simply hit ”Start Search” without
entering any criteria.</li>
<li>When searching by nationailty, this should be conducted using ISO
standard country abbreviations e.g. UK, DK, SE,</li>
</ul>
</td>
</tr>
</table>
</form>
</body>
</html>