php redirect problem

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
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

php redirect problem

Post by mhouldridge »

Hi,

I have pages which redirect the user if their session variable == 0

I have noticed a problem when the user logs in with an invalid username or password, here is my code;

Code: Select all

} else {  
    header ("location: http://www.something.com/login.php"); 
	exit();
This else statement is excuted when the user / pass is incorrect.

I get the following error;

Warning: Cannot modify header information - headers already sent by (output started at C:\Audit\checkuser.php:11) in C:\Audit\checkuser.php on line 337

Any ideas?
User avatar
mhouldridge
Forum Contributor
Posts: 267
Joined: Wed Jan 26, 2005 5:13 am

Post by mhouldridge »

I think I understand this now...

I believe i was sending two sets of headers...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply