Forums

PHP

This topic is locked

Header error on redirect if include is used

Posted 11 May 2006 08:37:40
1
has voted
11 May 2006 08:37:40 rob yorke posted:
Being new to PHP this may be simple but I'm experiencing a problem with PHP when trying to redirect after a SQL update operation.

---------The error----------
Warning: Cannot modify header information - headers already sent
-----------------------------

I understand why the error is being generated but can't see why its unhappy with my code. The problem is something to do with the my virtual include on the page header to my connection string. If I move the code from the include and place directly in my page the problem is fixed. I would much rather for obvious reasons stick to using includes for connection strings.

-------The include line---
<?php virtual('/Connections/PT.php');?>
---------------------------

----The include itself----
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_PT = "mysql4.computerbureau.co.uk";
$database_PT = "robPT_promo";
$username_PT = "robPT_promo";
$password_PT = "840av";
$PT = mysql_pconnect($hostname_PT, $username_PT, $password_PT) or trigger_error(mysql_error(),E_USER_ERROR);
---------------------------

Any help would be greatly appreciated

Replies

Replied 11 May 2006 12:10:43
11 May 2006 12:10:43 Roddy Dairion replied:
Check that there's is no blank line within your include page.

Reply to this topic