Why not:

if (!$searchtype || !$searchterm)
{
    echo "You have not entered any details. Please go back and try
again.";
    exit;
} else {
    // print out results
}
// print out rest of html file...


Mark Milaszkiewicz wrote:
> 
> hiya. i'm currently working on a really basic search function for my website
> and am using this code
> 
> trim($searchterm);
>         if (!$searchtype || !$searchterm)
>                 {
>                         echo "You have not entered any details. Please go back and 
>try again.";
>                         exit;
>                 }
> 
> to make sure that the user is entering a search into the box.
> 
> However, if i leave the exit off, it displays everything from the database,
> but if i leave it in, it doesn't  put in the rest of the html file that i
> want it to,
> 
> how can i make it skip the rest of the php within the document (so
> displaying no results from the database)
> 
> Cheers in advance
> 
> Marky
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
Chris Hobbs       Silver Valley Unified School District
Head geek:              Technology Services Coordinator
webmaster:   http://www.silvervalley.k12.ca.us/~chobbs/
postmaster:               [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to