<form action="?site=Search&amp;submit=true" style="display:inline;" method="post">
<input type="hidden" name="site" value="Search" />
<select name="searchBy" style="padding:0;">
<option>Nyheder</option>
<option>Artikler</option>
</select>
 - <select name="searchKey" style="padding:0;">
<option>Indeholder</option>
<option>Starter med</option>
<option>Er præcist</option>
</select> <input type="text" value="<?=$_POST['searchString']?>" name="searchString" style="padding:0;" /><input type="submit" value="Søg" name="submit" class="submit" style="padding:0;"  /></form>
<br />
<br />
<br />
<?php
if ($_GET["submit"] == "true" && isset($_POST['searchBy']) && isset($_POST['searchString']) && $_POST['submit'] == "Søg") {

if ($_POST['searchBy'] == "Nyheder") {

 if ($_POST['searchKey'] == "Starter med") {
$get_search = mysql_query("SELECT * FROM `pytox_nyheder` WHERE (`show` LIKE '1') AND (`overskrift` LIKE '{$_POST['searchString']}%' OR `nyhed` LIKE '{$_POST['searchString']}%') ORDER BY `id` DESC") or die(mysql_error());
 } else if ($_POST['searchKey'] == "Indeholder") {
$get_search = mysql_query("SELECT * FROM `pytox_nyheder` WHERE (`show` LIKE '1') AND (`overskrift` LIKE '%{$_POST['searchString']}%' OR `nyhed` LIKE '%{$_POST['searchString']}%') ORDER BY `id` DESC") or die(mysql_error());
 } else if ($_POST['searchKey'] == "Er præcist") {
$get_search = mysql_query("SELECT * FROM `pytox_nyheder` WHERE (`show` LIKE '1') AND (`overskrift` LIKE '{$_POST['searchString']}' OR `nyhed` LIKE '{$_POST['searchString']}') ORDER BY `id` DESC") or die(mysql_error());
 }

} else if ($_POST['searchBy'] == "Artikler") {

 if ($_POST['searchKey'] == "Starter med") {
$get_search = mysql_query("SELECT * FROM `pytox_artikler` WHERE (`show` LIKE '1') AND (`overskrift` LIKE '{$_POST['searchString']}%' OR `brodtekst` LIKE '{$_POST['searchString']}%' OR `artikel` LIKE '{$_POST['searchString']}%') ORDER BY `id` DESC") or die(mysql_error());
 } else if ($_POST['searchKey'] == "Indeholder") {
$get_search = mysql_query("SELECT * FROM `pytox_artikler` WHERE (`show` LIKE '1') AND (`overskrift` LIKE '%{$_POST['searchString']}%' OR `artikel` LIKE '%{$_POST['searchString']}%' OR `brodtekst` LIKE '%{$_POST['searchString']}%') ORDER BY `id` DESC") or die(mysql_error());
 } else if ($_POST['searchKey'] == "Er præcist") {
$get_search = mysql_query("SELECT * FROM `pytox_artikler` WHERE (`show` LIKE '1') AND (`overskrift` LIKE '{$_POST['searchString']}' OR `artikel` LIKE '{$_POST['searchString']}' OR `brodtekst` LIKE '{$_POST['searchString']}') ORDER BY `id` DESC") or die(mysql_error());
 }

}

if (mysql_num_rows($get_search) == 0) {
print "Ingen ting blev fundet med søgekritikerne ".$_POST['searchBy'].", ".$_POST['searchKey']." og ".$_POST['searchString'];
?>
<br />
<br />
Blev teksten, du søgte på, ikke fundet? Kan der være sket en fejl? - Så prøv igen, uden at trykke Enter, tryk blok på "Søg"
<?php
} else {

 while ($search = mysql_fetch_array($get_search)) {

if ($i == 0) {
$i = 1;
$bgcolor = "#EEE";
} else if ($i == 1) {
$i = 2;
$bgcolor = "#CCC";
} else if ($i == 2) {
$i = 0;
$bgcolor = "#FFF";
} else {
$i = 1;
$bgcolor = "#EEE";
}


	if ($_POST['searchBy'] == "Nyheder") {
?>
<table class="blackborder" cellpadding="2" cellspacing="0" style="background-color:<?=$bgcolor?>;">
 <tr>
  <td valing="top" aling="left">
<a href="?site=Nyheder&amp;archive=true&amp;highlight=<?=$_POST['searchString']?>"><strong><?=$search['overskrift']?></strong></a> - <?=$search['time']?>
<br />
<a href="?site=Nyheder&amp;archive=true&amp;highlight=<?=$_POST['searchString']?>"><?=$search['nyhed']?></a>
  </td>
 </tr>
</table>
<br />
<br />
<?php
	} else if ($_POST['searchBy'] == "Artikler") {
?>
<table class="blackborder" cellpadding="2" cellspacing="0" style="background-color:<?=$bgcolor?>;">
 <tr>
  <td valing="top" aling="left">
<a href="?site=Artikler&amp;artikelid=<?=$search['id']?>&amp;highlight=<?=$_POST['searchString']?>"><strong><?=$search['overskrift']?></strong></a> - <?=$search['time']?>
<br />
<a href="?site=Artikler&amp;artikelid=<?=$search['id']?>&amp;highlight=<?=$_POST['searchString']?>"><?=$search['brodtekst']?></a>
  </td>
 </tr>
</table>
<br />
<br />
<?php
	}
?>
<?php
 }
}
}
?>