I've made a search page, now it finally works, but it still gives the errors:

> 
> Notice: Undefined variable: x in C:\xampp\xampp\htdocs\horsemask\search.php on line 21  
> 
>  Notice: Undefined variable: construct in C:\xampp\xampp\htdocs\horsemask\search.php on line 23 
> 
> 
> 

I do use localhost, I don't know if thats the problem. It still gives hits and it works, but it looks ugly...
here is my code:

```
<?php

$button = $_GET ['submit'];
$search = $_GET ['search']; 

if(!$button)
echo "you didn't submit a keyword";
else
{
if(strlen($search)<=1)
echo "Search term too short";
else{
echo "Jou zoekterm <b>$search</b> leverde dit op: <hr size='1'></br>";
mysql_connect("localhost","root","");
mysql_select_db("search");

$search_exploded = explode (" ", $search);

foreach($search_exploded as $search_each)
{
$x++;
if($x==1)
$construct .="keywords LIKE '%$search_each%'";
else
$construct .="AND keywords LIKE '%$search_each%'";

}

$construct ="SELECT * FROM searchengine WHERE $construct";
$run = mysql_query($construct);

$foundnum = mysql_num_rows($run);

if ($foundnum==0)
echo "Er is niks gevonden op de zoekterm <b>$search<b>. Probeer een andere zoekterm.";
else
{
echo "$foundnum results found !<br>";

while($runrows = mysql_fetch_assoc($run))
{
$title = $runrows ['title'];
$desc = $runrows ['description'];
$url = $runrows ['url'];

echo "
<a href='$url'><b>$title</b></a><br>
$desc<br>
<a href='$url'>$url</a><p>
";

}
}

}
}

?>

```