Re: exit query

From: Date: Thu, 16 Aug 2001 23:36:11 +0000
Subject: Re: exit query
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11467@lists.php.net to get a copy of this message
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: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Chris Hobbs Silver Valley Unified School District Head geek: Technology Services Coordinator webmaster: http://www.silvervalley.k12.ca.us/~chobbs/ postmaster: chobbs@silvervalley.k12.ca.us

« previous php.db (#11467) next »