Jump to content

Archived

This topic is now archived and is closed to further replies.

ICEcoffee

need help with redirect

Recommended Posts

Hi there

 

Tried the code above, it didn't work, here is the adjusted code:

 

========================================================

if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] == "FRMcomplete")) {

$updateSQL = sprintf("UPDATE customers SET Callid=%s, Complete=%s WHERE ID=%s",

GetSQLValueString($HTTP_POST_VARS['Callid'], "int"),

GetSQLValueString($HTTP_POST_VARS['Complete'], "int"),

GetSQLValueString($HTTP_POST_VARS['ID'], "int"));

 

mysql_select_db($database_dandatoys, $dandatoys);

$Result1 = mysql_query($updateSQL, $dandatoys) or die(mysql_error());

header("Location:CallsOutstanding.php");

}

 

========================================================

 

I still get the error:

 

Warning: Cannot modify header information - headers already sent by (output started at.......

 

I also looked at the <?PHP tags at the start of the page and see no spaces.

 

So whats up?

 

Share this post


Link to post
Share on other sites

It means you have echoed information to the html already and PHP can't write to two differnt locations... you can however get around this by buffering the html before you output it.

 

Put

 

// This function will turn output buffering on. While output buffering is active no output 
// is sent from the script (other than headers), instead the output is stored in an internal buffer.
ob_start();  // This allows me to call the header() function  in the included files for redirecting

 

at the start of your php file.

 

and ..

 

ob_end_flush(); // flush buffer content to the screen

at the end of your php file.

 

it is important that you put the ob_start before anything else on the page as it may try to display information.

 

 

Share this post


Link to post
Share on other sites

It means you have echoed information to the html already and PHP can't write to two differnt locations... you can however get around this by buffering the html before you output it.

 

Put

 

// This function will turn output buffering on. While output buffering is active no output 
// is sent from the script (other than headers), instead the output is stored in an internal buffer.
ob_start();  // This allows me to call the header() function  in the included files for redirecting

 

at the start of your php file.

 

and ..

 

ob_end_flush(); // flush buffer content to the screen

at the end of your php file.

 

it is important that you put the ob_start before anything else on the page as it may try to display information.

 

 

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.