Post form values - script flow

From: Date: Tue, 21 May 2002 04:00:19 +0000
Subject: Post form values - script flow
Groups: php.general 
Request: Send a blank email to php-general+get-98615@lists.php.net to get a copy of this message
I am very new to PHP about two hours. I have a search page that I post back to the same URL. When the form is loaded I check to see if the seach variable is set ($srch is the name of the text box on the form) and then determine what function to call. I either call a welcome message function to be printed to the page or a function to search a database and build a table of results. I have included my script below....My question is: Is this a good way to handle search forms with PHP? Since I have no examples to work from I am not sure what the proper way is. Thanks for the help. if (isset($srch)){ if (strlen(trim($srch)) > 0) { $srch = strtoupper(trim($srch)); buildtable($srch); } else { dispwelcome(); } } else { dispwelcome(); }

« previous php.general (#98615) next »