Cannot modify header information - headers already


#1

When logging in my page is throwing the following
errors… I think this has to do with
extra blank spaces being in the config.ini php
file…which I can’t seem to find:
Warning: Cannot modify header information - headers already sent by (output started at /home/.input/ddole/web.com/login.php:6) in /home/.input/ddole/web.com/login.php on line 164

How do I correct the error?

Thanks

Here is the code I copied from the website:

Agent Login Rate Plans Availability Features Frequently Asked Questions Support Sales Agents <?php require "myweb.inc"; require "authentication.inc"; if (!empty($_POST["username"])&&!empty($_POST["password"])) { $user=$_POST["username"]; $pwd=$_POST["password"]; $connection = mysql_connect($hostname,$g_username,$g_password) or die("Could not connect"); mysql_select_db($database,$connection)or die ("could not select database"); if (authenticate_user($connection,$user,$pwd)) { // session_start(); header("Location:registration.php"); } else { print " invalid username/password"; } } ?>
Username
Password

#2

Your php code sends header information. This header must be sent before any output to the browser. Meaning before any html code. There is a command to place a hold on the header and render all to once, but I don’t recall at the moment.
You could try and move your php code to the top of your page, and use an if statement which will determine if the code should run or display the html.
Silk


#3

My god, this was cross posted, too? Dude, you really need to learn some forum etiquettes.


yerba# rm -rf /etc
yerba#


#4

Thanks.

We did this yesterday…but it did not help
matters…just moved the error to a differnt line…i’m
not aware of the command you’re referring to but will
experiment with it if you can kindly post it.


#5

There can’t be any spaces of any kind before the first <? if you’re attempting to do a header() redirect. Nothing, not a return, space, period, nothing.

The very first two characters in the file MUST be <?.


yerba# rm -rf /etc
yerba#


#6

u must have some kind of white space printed out before pushing the header.
try finding out where it is…

if u are lazy…
use ob_start() in the first line of ur php