I am calling a file_put_contents()
inside of a PHP script that is executed via AJAX. Whenever I execute this script the client page gets reloaded which is not desirable. Is there a way to prevent the PHP script from reloading the page?
I have tried modifying the headers using the following and passing it as the context parameter in the file_put_contents
function:
$context = stream_context_create(
array(
'http' => array(
'follow_location' => false
)
)
);