I have developed a tool with PHP, it scans 300+ websites and check their source codes. with curl. It is working well, but in XenForo, I get header error. I need use flush(); to avoid timeout problem and dont force users to wait... And I have to solve this header problem... I think it is about...
@Kirby my codes like this:
<?php
if (ob_get_level() == 0) ob_start();
for ($i = 0; $i<10; $i++){
echo "<br> Line to show.";
echo str_pad('',4096)."\n";
ob_flush();
flush();
}
ob_end_flush();
?>
I am using flush(); to run codes while the page is loading...
Okey, I will try. :) And I have fixed the count error as:
if(empty($emptyarray)){
$count = 0;
}else{
$count = count($emptyarray);
}
But I could not fix this error:
An exception occurred: [ErrorException] [E_WARNING] Cannot modify header information - headers already sent by (output started at...
Normally, there is no issue in my codes... I get classical PHP errors. Scripts is running well but I need to disable error handling... Because I think it is not possible to fix count($emptyarray); error. Or a header sent error... There should be a way...
I couldnt fix them. I am using ob_start(); function and so I get Cannot modify header information - headers already sent by error. Also, think that there is an empty array, while I am using count($emptyarray); I got error too... How can I fix them?
I have tried them but not worked:
ini_set('display_errors', 0);
error_reporting(0);
error_reporting(E_ALL | E_STRICT & ~8192);
Errors still get displayed.
Hi, how are you?
I have just developed a PHP script and using this in a page node with callbacks. But I get some little PHP errors like:
Cannot modify header information - headers already sent by
I entered this code: XenForo_Application::disablePhpErrorHandler();
But not working, now I am...
I was running on /forum/pages/xxxx --- and I have just solved.
$csrftoken = \XF::app()->get('csrf.token');
echo '<input type="hidden" name="_xfToken" value="'.$csrftoken.'">';
just add $csrftoken in your form with "_xfToken" name.
Hey, how are you?
I have just created a page in XF but while I am trying to send a POST request, I get this error:
Security error occurred. Please press back, refresh the page, and try again.
I think this error causes because of CSRF protection. How can I disable the CSRF protection in my...
Yes! Finally system detected my class, very thanks... But a little question: how can I print a text? echo 'hello'; and return 'hello'; didnt worked, what can I do?
Updated index.php as:
<?php
class TestCallbacks_index
{
public static function getHtml(\XF\Pub\Controller\AbstractController $controller, \XF\Mvc\Reply\AbstractReply &$reply)
{
return 'tesssttt';
}
}
but still the same problem... Callback...