Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

Cannot modify header information


  #1  
Old Oct 9, 2011, 08:14 PM
prathod
 
7 posts · Sep 2011
Hello,

I am adding user login and authentication to my website.

I am using following code in checklogin.php file:

try {
login($username, $password);
session_start();
$_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.

<phpcode>
<?php
session_start();
if(!session_is_registered(valid_user)){
header("Location: invalid login wbpage");
}
?>
</phpcode>


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 !
  #2  
Old Oct 10, 2011, 05:42 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what version of Atahualpa and WP?
What is the url?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Oct 10, 2011, 09:58 AM
prathod
 
7 posts · Sep 2011
I am using WordPress 3.2.1 and Atahualpa 3.6.7

Please let me know, which URL shall I send it to you.

Thanks !

-----

Just an update...this code is working fine on localhost, but once I move it to host server I am getting that error. I have same WP and Atahualpa versions on localhost.

Thanks !

Last edited by prathod; Oct 10, 2011 at 12:12 PM.
  #4  
Old Oct 10, 2011, 01:29 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
what is the site's url - where I can see the issue
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Oct 10, 2011, 01:39 PM
prathod
 
7 posts · Sep 2011
Quote:
Originally Posted by juggledad
what is the site's url - where I can see the issue
See here :
Thanks !

Last edited by prathod; Oct 10, 2011 at 03:19 PM.
  #6  
Old Oct 10, 2011, 02:44 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Quote:
Warning:Cannot modify header information –headers already sent by (output started at /home/unosatl/esatnebraska.org/wp-content/plugins/fv-wordpress-flowplayer/view/frontend-head.php:48) in /home/unosatl/esatnebraska.org/wp-content/plugins/exec-php/includes/runtime.php(42):eval()’d code on line 5
so this is saying that the plugin exec-php has an error evaluating some of your code.

This has nothing to do with the theme.
How many places have you put PHP code into a page or a widget? Remove them one by one till you find the offender.

Why are you coding a login your self and not using one of the login plugin's?
see [SOLVED] A login plugin that will point to two different pages depending...
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by lmilesw; Oct 10, 2011 at 05:58 PM.
  #7  
Old Oct 10, 2011, 03:18 PM
prathod
 
7 posts · Sep 2011
Quote:
Originally Posted by juggledad
so this is saying that the plugin exec-php has an error evaluating some of your code.

This has nothing to do with the theme.
How many places have you put PHP code into a age or a widget? Remove them one by one till you find the offender.

Why are you coding a login your self and not using one of the login plugin's?
see [SOLVED] A login plugin that will point to two different pages depending...
I do not have access to open the login page you mentioned...can you please help?

Thanks !
  #8  
Old Oct 10, 2011, 03:21 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
That thread is in the GOLD FORUM (available to users who have donated $20 or more) but it suggested using the 'Capability Manager' plugin
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

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 02:29 AM
Proverbial Cannot modify header information error billy1234 Header configuration & styling 1 Mar 26, 2010 06:30 AM
Adding contact information to the header? Igor Header configuration & styling 2 Nov 5, 2009 03:27 PM
Warning: Cannot modify header information - headers already sent by Stepien Header configuration & styling 4 May 8, 2009 07:50 AM


All times are GMT -6. The time now is 01:06 AM.


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