Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Cannot modify header information

Build custom WP THEMES, without
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
Prev Previous Post   Next Post Next
Old Oct 9, 2011, 09:14 PM
7 posts · Sep 2011
Cannot modify header information


I am adding user login and authentication to my website.

I am using following code in checklogin.php file:

try {
login($username, $password);
$_SESSION['valid_user'] = $username;
header("Location: webpage1");
}catch (Exception $e){
header("Location: webpage2");

I am using login method to validate userid and password from database. After successful login the user goes to webpage1.

At webpage1, before displaying the content I am trying to verify - if the user really logged in. Just to make sure that someone should not access the webpage2 without proper authentication. Therefore, I am adding below code at the start of webpage1.

header("Location: invalid login wbpage");

However, I am getting below error:

Warning:Cannot modify header information - headers already sent by (output started at /home/foldername/websitename/wp-includes/link-template.php:1203) in /home/foldername/websitename/wp-content/plugins/pluginfolder/page.php on line 4

After reading some posts before, I removed any space at the end of page where ?> is present. But still not working.

Can you please help me with this?

Thanks in Advance !


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Warning: Cannot modify header information - headers already sent by ... bruno-d-horse New Versions, & Updating 5 Mar 31, 2010 03:29 AM
Proverbial Cannot modify header information error billy1234 Header configuration & styling 1 Mar 26, 2010 07:30 AM
Adding contact information to the header? Igor Header configuration & styling 2 Nov 5, 2009 04:27 PM
Warning: Cannot modify header information - headers already sent by Stepien Header configuration & styling 4 May 8, 2009 08:50 AM

All times are GMT -6. The time now is 06:17 PM.

Powered by vBulletin® Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.