Welcome Guest, Not a member yet? Register   Sign In
Server Sent Events With Codeigniter 4
#4

(12-24-2020, 01:30 PM)includebeer Wrote:
PHP Code:
headers already sent by (output started at /var/www/webScraper/app/Common.php:130

Often the error for header already sent means there’s an error message that was printed. 
What do you have on line 130?

echo "id:". $id . PHP_EOL;

this is the code i have on line 130 on common.php file.  complete function is as below

PHP Code:
function sendMsg($id$message$progress
{
    $d = array('message' => $message'progress' => $progress);

    echo "id:"$id PHP_EOL;    // Line number 130
    echo "data:"json_encode($d) . PHP_EOL;
    echo PHP_EOL;
    
    //PUSH THE data out by all FORCE POSSIBLE
    ob_end_flush();
    flush();

Reply


Messages In This Thread
RE: Server Sent Events With Codeigniter 4 - by midhunlalkc - 12-25-2020, 11:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB