Page 1 of 1

Question About Header Function

Posted: Fri Aug 04, 2006 12:26 pm
by PastorHank
from my reading of the Header function I should be able to use it to go to a particular web page using

Code: Select all

header("Location: http://www.something.com/somepage.htm");
exit;
and then the program should load the desired web page. Am I reading it correctly? the reason I ask, is I get nothing but a blank page and it doesn't look like the browser is being redirected anywhere.

thank you

Posted: Fri Aug 04, 2006 12:34 pm
by jayshields
Make sure nothing is output to the browser before your call to header(), you should know if you are doing this incorrectly by the errors returned though.

Posted: Fri Aug 04, 2006 12:47 pm
by PastorHank
that's the strange thing, it's not generating any error message, it just returns a blank page

Posted: Fri Aug 04, 2006 12:50 pm
by RobertGonzalez
Blank page means critical error and display_errors is Off.

Posted: Fri Aug 04, 2006 12:53 pm
by PastorHank
Ahh, thank you. I think I need to go through the code a line at a time, it's got to be something simple...

Posted: Fri Aug 04, 2006 1:29 pm
by RobertGonzalez
Look for unmatched brackets/parentheses or mising semicolons. Those are the usual suspects.

Posted: Fri Aug 04, 2006 1:38 pm
by PastorHank
And that is exactly what it was, once I cleaned out the code, it started working...also I found checking for the number of rows equaling zero didn't work as well as checking for number of rows being less than 1.

Thanks for the suggestions.