473,383 Members | 1,801 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Strange output error

hi all,

I have this strange error: when I need to use the database on a page I
include connectionDB.php with inculde_once("connectionDB.php");
The connectionDB.php looks like this:

<?
$db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
mysql_select_db("xxxxx",$db);
?>

when I use the header("Location: goto.php"); function after the
connectionDB.php code is included I get
Warning: Cannot modify header information - headers already sent by (output
started at C:\Inetpub\webpub\S11Mate\html01\connectionDB.php: 4) in
C:\Inetpub\webpub\S11Mate\html01\login.php on line 60

This means that connectionDB.php is sending to the browser? Being more
specific, line number 4, ?> . Someone knowswhats going wrong.

kind regards
Stijn
Jul 17 '05 #1
6 1989
Stijn Goris wrote:
[...]
The connectionDB.php looks like this:

<?
$db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
mysql_select_db("xxxxx",$db);
?>

____^_

maybe a space there?

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Jul 17 '05 #2

"Pedro" <he****@hotpop.com> wrote in message
news:bl************@ID-203069.news.uni-berlin.de...
Stijn Goris wrote:
[...]
The connectionDB.php looks like this:

<?
$db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
mysql_select_db("xxxxx",$db);
?>

____^_

maybe a space there?

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.


I don't think a space can cause the error. I put spaces and tabs all around
my code to make it better looking.

But the problem has disapeared for some reason.

regards
Jul 17 '05 #3
On Fri, 26 Sep 2003 18:53:14 +0200, Stijn Goris wrote:

"Pedro" <he****@hotpop.com> wrote in message
news:bl************@ID-203069.news.uni-berlin.de...
Stijn Goris wrote:
[...]
> The connectionDB.php looks like this:
>
><?
> $db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
> mysql_select_db("xxxxx",$db);
> ?>

____^_

maybe a space there?

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes) in the subject
line, or your mail will be ruthlessly discarded.


I don't think a space can cause the error. I put spaces and tabs all
around my code to make it better looking.

The space in this case _would_ matter, as this would be sent as "text" to
the browser more than likely before another header call. I fell prey to
this the other day with a script after I insterted a blank line after the
closing '?>' chars. This was in the header section with more header code
below.. and threw the same error your script has done. Removing the blank
line fixed the problem instantly. Tabs / spaces within the <?php ?> tags
are neither here nor there =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.

Jul 17 '05 #4

"Ian.H" <ia*@WINDOZEdigiserv.net> wrote in message
news:pa****************************@hybris.digiser v.net...
On Fri, 26 Sep 2003 18:53:14 +0200, Stijn Goris wrote:

"Pedro" <he****@hotpop.com> wrote in message
news:bl************@ID-203069.news.uni-berlin.de...
Stijn Goris wrote:
[...]
> The connectionDB.php looks like this:
>
><?
> $db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
> mysql_select_db("xxxxx",$db);
> ?>
____^_

maybe a space there?

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes) in the subject
line, or your mail will be ruthlessly discarded.


I don't think a space can cause the error. I put spaces and tabs all
around my code to make it better looking.

The space in this case _would_ matter, as this would be sent as "text" to
the browser more than likely before another header call. I fell prey to
this the other day with a script after I insterted a blank line after the
closing '?>' chars. This was in the header section with more header code
below.. and threw the same error your script has done. Removing the blank
line fixed the problem instantly. Tabs / spaces within the <?php ?> tags
are neither here nor there =)

Regards,

Ian

--
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.


Thanks, that makes sence... after the ?> .

kind regards and and great thanks for the help
Stijn
Jul 17 '05 #5
Stijn Goris wrote:

"Pedro" <he****@hotpop.com> wrote in message
news:bl************@ID-203069.news.uni-berlin.de...
Stijn Goris wrote:
[...]
> The connectionDB.php looks like this:
>
><?
> $db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
> mysql_select_db("xxxxx",$db);
> ?>

____^_

maybe a space there?

I don't think a space can cause the error. I put spaces and tabs all around
my code to make it better looking.

But the problem has disapeared for some reason.


I tested a file with a space after the closing "?>" and I got that
error. My editor strips trailing spaces on save, so I had to reconfigure
it to be able to test :-)
Of course it's now back to the previous configuration.

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Jul 17 '05 #6
Once you got your the error on your browser, did you try to view the source
by clicking the "Source" option from the "View" menu (if you're using
Internet Explorer).

You'll probalby see another error message related to your mysql_connect() or
mysql_db() command.

I guess you have a connection error...
"Pedro" <he****@hotpop.com> wrote in message
news:bl************@ID-203069.news.uni-berlin.de...
Stijn Goris wrote:

"Pedro" <he****@hotpop.com> wrote in message
news:bl************@ID-203069.news.uni-berlin.de...
Stijn Goris wrote:
[...]
> The connectionDB.php looks like this:
>
><?
> $db = mysql_connect("localhost", "xxxxxx, "xxxxxx");
> mysql_select_db("xxxxx",$db);
> ?>
____^_

maybe a space there?

I don't think a space can cause the error. I put spaces and tabs all around my code to make it better looking.

But the problem has disapeared for some reason.


I tested a file with a space after the closing "?>" and I got that
error. My editor strips trailing spaces on save, so I had to reconfigure
it to be able to test :-)
Of course it's now back to the previous configuration.

--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Federico | last post by:
Hi all, I don't know if this topic is perhaps a little bit off-topic, anyway I have a strange problem in transforming an XML file in an HTML file using XSLT form a Java program written with...
24
by: LineVoltageHalogen | last post by:
Greetings All, I was hoping that someone out there has run into this issue before and can shed some light on it for me. I have a stored procedure that essentially does a mini ETL from a source...
8
by: grundmann | last post by:
Hello, i got a strange compiler error. When compiling the following: // forward declarations typedef AvlTree<LineSegment,LineSegmentComperator> LSTree; void handleEventPoint (const...
6
by: Rick | last post by:
Hi, Sorry, I couldn't find a better title for this post. Anyway, I got a piece of C code which only works well if I put a fprintf in it. Here's the code : unsigned int8 Port_getPortNum( char...
6
by: leonecla | last post by:
Hi everybody, I'm facing a very very strange problem with a very very simple C program... My goal should be to write to a binary file some numbers (integers), each one represented as a sequence...
6
by: Gary | last post by:
I have an application that has been working just fine for a couple of years. It queries a SQL database and returns some formatted data back to the client. I have a new client, who has a larger...
1
by: Martin Feuersteiner | last post by:
Dear Group I'm having a very weird problem. Any hints are greatly appreciated. I'm returning two values from a MS SQL Server 2000 stored procedure to my Webapplication and store them in...
5
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view...
5
by: ProgrammerMatt | last post by:
I searched for a similar error, and I didn't find any helpful references, so I'm trying not to post a redundant thread. I am programming for my summer job using Microsoft Visual C++ 6.0, and a...
9
by: Larry | last post by:
I was testing the buffer size of system call, read(), and found a strange error on Ubuntu 7.10 server. The code is attached. If the BUFFSIZE is set to from 128 to 255, the code will produce an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.