Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie:(( unable to redirect.

Status
Not open for further replies.

psteja2000

Programmer
Feb 1, 2005
82
US
I am given an task to convert coldfusion application to php.

I get this error always don't know y..

I include a file 'sqldbcon.php' which has just two lines of php code, to connect to database.
<?php
$con=mysql_connect("","username","");
$DB=mysql_select_db("dbname",$con);
?>

I include this in another file A.php

somewhere in A.php I say, header("location: blah blah")

It failes to redirect saying header information already sent in sqldbcon.php

???????

can anyone please help?

regards,
Teja
 
The use of the header() function must be invoked before your script outputs anything.

Look for print or echo statements in your code.
Look for error output from your code.
Look for blank lines that appear outside of <?php ?> tags.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
sleipnir214,

Thank you very very much. it is the stray spaces and blank lines that is causing hte trouble. I never knew that would make a difference...

Teja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top