Well, anytime the search form is submitted check to see if their IP address has already been added to your database. If not, add it with a column that tracks how many times they have searched. If they have been added, increment the tracking number value by one (now it should be 2). Before a user can even view the search form, however, you should check to see if their IP is in your database. If it is and they have already searched >= 2 times, redirect to the registration page.
// Form Submission
$IP_address = mysql_real_escape_string($_SERVER['REMOTE_ADDR']);
$result = mysql_query("SELECT `searches` FROM `search_log` WHERE `ip`='$IP_address' LIMIT 1");
if($result){
if(mysql_num_rows($result) == 0){
mysql_query("INSERT INTO `search_log` (`ip`, `searches`) VALUES ('$IP_address', 1)");
} else {
$row = mysql_fetch_assoc($result);
if($row['search'] >= 2){
header("Location: registration.php");
exit();
} else {
mysql_query("UPDATE `search_log` SET `searches`=`searches`+1 WHERE `ip`='$IP_address' LIMIT 1");
}
}
}