Web Hosting Talk







View Full Version : mysql errors


bigtiger
10-27-2001, 05:28 PM
I keep getting this error after setting up my help desk This is the first time using mysql and php and not sure of what i'm doing wrong.

Warning: Cannot send session cookie - headers already sent by (output started at /home/hostplan/public_html/support/include/database.php:81) in /home/hostplan/public_html/support/index.php on line 6

Warning: Cannot send session cache limiter - headers already sent (output started at /home/hostplan/public_html/support/include/database.php:81) in /home/hostplan/public_html/support/index.php on line 6


Thanks

Tony

(SH)Saeed
10-27-2001, 07:10 PM
That is a PHP error and not MySQL. It's telling you exactly what the problem is, you have to send cookie information first..

For example:

The correct way..

<?
setcookie();
echo "cookie has been set";
?>

The wrong way..

<?
echo "cookie has been set";
setcookie();
?>

from http://www.php.net/manual/en/function.setcookie.php
setcookie() defines a cookie to be sent along with the rest of the header information. Cookies must be sent before any other headers are sent (this is a restriction of cookies, not PHP). This requires you to place calls to this function before any <html> or <head> tags.

Am I making any sense?

ffeingol
10-27-2001, 07:20 PM
bigtiger,

Is this something you wrote or something you downloaded/purchased?

If it's a download/purchase, my guess is that there was some sort of config file you had to edit. If that's the case, make sure there are no blank lines or spaces after the last ?> in that file.

Frank

bigtiger
10-27-2001, 08:10 PM
Originally posted by ffeingol
bigtiger,

Is this something you wrote or something you downloaded/purchased?

If it's a download/purchase, my guess is that there was some sort of config file you had to edit. If that's the case, make sure there are no blank lines or spaces after the last ?> in that file.

Frank

The program is php helpdesks


That was it.... thanks for your help. You learn somthing new everyday....

BigTiger

ffeingol
10-27-2001, 08:14 PM
No problem.

That one gets everyone with their first php application.

Frank

bobcares
11-26-2001, 04:13 AM
This error would have come because an error mesasage was displayed before the headers were displayed.
Have a nice day :)
regards
amar