Background: OS - Windows NT; php 4.0.4 running as cgi
Here's pseudo code:
function my_function{
if ($variable){
query the db
if (result from query){
print some html out to the page and then.
exit; //exit number one.
}
} else {
header("location: yadda");
exit;
}
my_function();
header("location: different yadda");
So, essentially, if a variable exists, I want to look something up in the db (MSSQL7), if that look up produces a result, I want to print a warning message and exit the script - else fall through the function and send them to another page.
This script will work as long as I take the 'exit' out that's marked "exit number one" above. I get the warning and then a "can't add more header information" because it's fallen through to the redirect. If I have that first exit in there, the script just hangs and hangs and hangs. I've tried die, break, exit...none work.
This works fine running in ISAPI mode, but not CGI mode. I found no mentions in the manual of exeptions for the exit in cgi...anyone have any ideas?