Jump to content

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?

 

Link to comment
https://forums.phpfreaks.com/topic/1702-need-help-with-redirect/
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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/1702-need-help-with-redirect/#findComment-5569
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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/1702-need-help-with-redirect/#findComment-5570
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.