Forums

PHP

This topic is locked

page redirect errors

Posted 13 May 2006 08:52:32
1
has voted
13 May 2006 08:52:32 ikotun ikotun posted:
i am getting this annoying error when trying to redirect pages using the header function...

this is the error i'm getting

Warning: Cannot modify header information - headers already sent by (output started at /home/neoso2/public_html/victory/login.php:10) in /home/neoso2/public_html/victory/login.php on line 238

and this is my code... i need help as i'm getting frustrated here ...!!

<?php
require "db_production.inc";
require "authentication.inc";
if (!empty($_POST["username"])&& !empty($_POST["password"]))
{
$user=$_POST["username"];
$pwd=$_POST["password"];
$connection = mysql_connect($hostname,$username,$password) or die("Could not connect";
mysql_select_db($database,$connection)or die ("could not select database";
if (authenticate_user($connection,$user,$pwd))
{
//print "Welcome ".$user;
header("Location: www.neo-solve.com/victory/MaintainAnnouncements.php");
exit;
}
else
{
print "invalid username/password";
}
}
?>

Replies

Replied 15 May 2006 11:52:40
15 May 2006 11:52:40 Roddy Dairion replied:
header() normally prints this error when there's a display line in the page by this i mean that there's an echo in your page that is executing after the header(), it can also be a blank line either in the page itself or your include page. Check on line 238 for a blank line.

Reply to this topic