Click to See Complete Forum and Search --> : Something about headers?


solidariti
12-07-2005, 05:19 AM
Hi I have tried seraching for this but couldnt find anything.

Here are the errors when I ran the site:

Warning: Cannot modify header information - headers already sent by (output started at /berw/ugrad1/base/j/jra3/public_html/organiser/conn.php:13) in /berw/ugrad1/base/j/jra3/public_html/organiser/index.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /berw/ugrad1/base/j/jra3/public_html/organiser/conn.php:13) in /berw/ugrad1/base/j/jra3/public_html/organiser/index.php on line 27

Heres the code that is producing it, any ideas what to do? Why this is causing it?:


<?php

require("conn.php");

if ($_POST['btnLogin'] != "") {

//check the username and password

$user = $_POST['userEmail'];

$pass = $_POST['userPassword'];



$result = mysql_query("SELECT * FROM tblUsers WHERE userEmail = '" . $user . "' AND userPassword = '" . $pass . "'");

if (mysql_num_rows($result) != 0) {

//if they match we are logged in

$row = mysql_fetch_array($result);

setcookie ("organiser", $row['userGUID'],time()+31449600, "/");



header("Location:organiser.php");

}else{

$nologin = true;

}

}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



<html>

Sheldon
12-07-2005, 05:36 AM
Add Ob_start(); In The 1 Line :)

solidariti
12-07-2005, 05:49 AM
Cheers, I am right in thinking that this turns on output buffering, does it store stuff internally, how and why does this work?

LiLcRaZyFuZzY
12-07-2005, 05:56 AM
http://www.php.net/ob_start