-1

Possible Duplicate:
Headers already sent by PHP

Greeting open source lovers.

Can somebody please explain to me what error pasted below means, I came acros it just after storing my session variable and redirecting my user to home page using header("Location:home.php"); function. any help will be appreciated.

Warning: Cannot modify header information - headers already sent by 
    (output started at C:\xampp\htdocs\testproject\login.php:58) 
    in C:\xampp\htdocs\testproject\inc\checklogin.php on line 35
Community
  • 1
  • 1
Ramz
  • 9
  • 3

2 Answers2

2

It means you're outputting some content to the page before redirecting or using another header. For example something like this:

<?php
  echo 'this will not work';
  header('Location: some page.php');
?>
Cosmin
  • 1,482
  • 12
  • 26
Erik
  • 2,276
  • 1
  • 20
  • 20
-1

From the error you provided I guess you have included or require_onced the checklogin.php in the login.php script. That is why the php gives out that error. In the login system you don't really need to do that. just redirect the user from login to checklogin and redirect to home if login is correct or to login if the login is not correct..

Miro Markaravanes
  • 3,285
  • 25
  • 32
  • Yes I have included the checklogin.php hence it has a function that I'm calling to process login details i.e – Ramz Sep 06 '12 at 14:59
  • That is causing the error maybe. Why do you include it? just send the form to checklogin, and let it process the login and do the redirection. – Miro Markaravanes Sep 06 '12 at 16:20
  • Aw I've included it because I am using action="?R=na" to display error messages on the same form is user details are wrong or the fields are empty therefore I'm using a querystring to check if its set then if it is I'm calling checklogin to do the rest.I hope the statement is not confusing I'm realy new to this platform so I'm learning here. – Ramz Sep 06 '12 at 17:09