Error while connecting to a remote MySQL-database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sanverm
Forum Newbie
Posts: 2
Joined: Mon Dec 20, 2004 10:04 am

Error while connecting to a remote MySQL-database

Post 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.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post 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.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

sanverm
Forum Newbie
Posts: 2
Joined: Mon Dec 20, 2004 10:04 am

Post 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?
lostboy
Forum Contributor
Posts: 329
Joined: Mon Dec 30, 2002 8:12 pm
Location: toronto,canada

Post by lostboy »

Any spaces are output to the browser and carraige returns also qualify as output
Post Reply