Question About Header Function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PastorHank
Forum Contributor
Posts: 117
Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country

Question About Header Function

Post 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
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post 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.
PastorHank
Forum Contributor
Posts: 117
Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country

Post by PastorHank »

that's the strange thing, it's not generating any error message, it just returns a blank page
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Blank page means critical error and display_errors is Off.
PastorHank
Forum Contributor
Posts: 117
Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country

Post 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...
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Look for unmatched brackets/parentheses or mising semicolons. Those are the usual suspects.
PastorHank
Forum Contributor
Posts: 117
Joined: Sat Jun 03, 2006 7:58 am
Location: Texas Hill Country

Post 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.
Post Reply