Jump to content


Photo

need help with redirect


  • Please log in to reply
2 replies to this topic

#1 ICEcoffee

ICEcoffee
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 27 February 2004 - 05:48 PM

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?


#2 dereko

dereko
  • Members
  • Pip
  • Newbie
  • 7 posts
  • LocationIreland

Posted 01 March 2004 - 07:46 PM

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.


[br]Jeebers[br][span style=\'font-size:9pt;line-height:100%\']eBusiness Solutions[/span][br]

"I like dogs.....  Dogs are smart, you never see a dog walk in a human sh*t!"


#3 dereko

dereko
  • Members
  • Pip
  • Newbie
  • 7 posts
  • LocationIreland

Posted 01 March 2004 - 07:49 PM

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.


[br]Jeebers[br][span style=\'font-size:9pt;line-height:100%\']eBusiness Solutions[/span][br]

"I like dogs.....  Dogs are smart, you never see a dog walk in a human sh*t!"





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users