PDA

View Full Version : Header error


Bengal313
12-11-2002, 03:15 PM
When Try to update a page that contains user information. After clicking go update I get this error. Can someone help me sort this out.

"
Warning: Cannot add header information - headers already sent by (output started at /var/www/html/hotel demo/bookings/change_booking_details.php:2) in /var/www/html/hotel demo/bookings/change_booking_details.php on line 55
You have an error in your SQL syntax near '' at line 1/

"

Kiwi
12-11-2002, 04:00 PM
Your header needs to be the first thing sent to the browser. If anything else is sent first, then a header is already created. The error is telling you that on line two something has already been outputted to the browser.

Ökii
12-11-2002, 04:01 PM
It would seem that you are trying to sent headers after content has started to be passed to the client

Any header / session or cookie setting call must occur before anything (even a blank line) is sent to the client.

ie]

<html><?php header("location: "); ?>

is bad

<?php header("location: "); ?>
<html

is fine.

Either build the page as an object or move the header calls above client output.

beaten by a minute :(

je_suis_dan
12-13-2002, 08:57 AM
Thanks... I've just been trying to firgure this one out as well... :thumbsup: