FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP header command





asiddle423
can anyone help i keep getting this error message and i cant see why

Warning: Cannot modify header information - headers already sent by (output started at /home/asiddle4/public_html/header.inc:59) in /home/asiddle4/public_html/login.php on line 23


my header file is below starting from line 51

<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>CMS Tutorial</title>
</head>

<body>
<table align="center" style="border: 1px solid #000000;" width="770" height="100%" bgcolor="#275F81" border="0" cellspacing="10" cellpadding="0">
<tr>
<td>
<table align="center" width="750" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="banner.jpg" width="750" height="150" /></td>
</tr>
</table>
<table align="center" width="750" style="border-left: 1px solid #000000;border-right: 1px solid #000000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="left" width="174" background="header.jpg" style="border-right:1px solid #000000;border-bottom:1px solid #000000;"> Navigation </td>
<td height="25" align="center" width="400" background="header.jpg" style="border-right:1px solid #000000;border-bottom:1px solid #000000;">News</td>
<td height="25" align="left" width="174" background="header.jpg" style="border-bottom:1px solid #000000;"> Other </td>
</tr>
</table>


and the login file is below starting from line 20

$query = mysql_query("SELECT username,password FROM users WHERE username = '$username'") or die(mysql_error());
$row = mysql_fetch_array($query);
$_SESSION["s_username"] = $row['username'];
header("Location: layout.php");


thanks asiddle423
Simulator
the header has to go before the HTML tag...
clip
true. it has to have a form with a post method.

Code:

<?php
if(isset($_POST('submit'))) //check if user clicked the submit button
{
//queries
//header commands
}
?>

<form method="post">
 username:<input type="textbox" name="username"><br/>
 <input type="submit" value="submit" name="submit">
</form>


buffering could also be an answer, but I'm not good at buffering yet. Very Happy
Related topics
htaccess Password Protection
I need georgia.ttf .... How can I do it ?
Fantastico could be updated
Need a little help
Switching Domains and Hosting Please Read!!!
simple php to mysql form doesn't work
Wap n PhP
Automatic download start !!
Can Php call command line interfaces on the OS
PHP issues >.>
Random Scripts download...
PHP sig help[solved]
301 redirection in PHP and .htaccess
header already sent? (and now introducing a mysql problem)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.