Page 1 of 1

Error while connecting to a remote MySQL-database

Posted: Mon Dec 20, 2004 10:13 am
by sanverm
I'm pretty new to PHP and MySQL, but I made a script to login in a members section on my site. It worked, but now I changed the location of the database and I got this warning-message below.
------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home/projects/mijndomein3/default/detritus/rechtswinkeloverbetuwe.nl/www/config.php:17) in /home/projects/mijndomein3/default/detritus/rechtswinkeloverbetuwe.nl/www/inloggen.php on line 23
------------------------------------------------------------------------------
The database is hosted on a remote server (http://www.freesql.org) and the site is hosted in Holland (http://www.rechtwinkeloverbetuwe.nl). I know it's not a MySQL connection problem.

Posted: Mon Dec 20, 2004 11:22 am
by markl999
What is line 17 of config.php ?
That line is outputting something and line 23 of inloggen.php looks like it has something like a Header("Location .. in it. The output from line 17 of config.php is causing the problem in inloggen.php as headers must be sent before any output.

Posted: Mon Dec 20, 2004 11:25 am
by John Cartwright

Posted: Tue Dec 21, 2004 3:06 am
by sanverm
markl999 wrote:What is line 17 of config.php ?
That line is outputting something and line 23 of inloggen.php looks like it has something like a Header("Location .. in it. The output from line 17 of config.php is causing the problem in inloggen.php as headers must be sent before any output.

I did know all the things you guys mentioned, but the remark above made me think.... there is NO line number 17 in config.php!
So, I just pressed backspace 2 times at the bottom of config.php and the problem was solved.

I did't know this could happen. Why does php give an error when I have pressed "enter" two extra times at the bottom of a php-page?

Posted: Tue Dec 21, 2004 9:34 am
by lostboy
Any spaces are output to the browser and carraige returns also qualify as output