i have a page called call.php with this codes
<script src="http://localhost/js/jquery.js"></script>
<script>
$(document).ready(function()
{
$.post("exe.php",
{
a: 'a'
},
function(data)
{
alert(data);
});
});
</script>
///close tabs after onload
and in exe.php i have this code
<?php
set_time_limit(60);
ignore_user_abort(true);
sleep(20);
$file = fopen("test.txt","w");
?>
i need to continue php execution even after closing tab immediately it works fine in localhost using WAMP but in my host doesn't work it stops after perhaps 10-14 secs in localhost and server ignore_user_abort(true) is off the question is : turning this function ON solves the problem? and why in localhost it works even when this function is off
my execution takes about 30 sec times i need to get it working
EDIT
i tried something like this
<?php
ignore_user_abort(true);
function shutdown()
{
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/2.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/4.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/6.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/8.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/10.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/12.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/14.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/16.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/18.txt',"w");
sleep(2);
$file = fopen($_SERVER["DOCUMENT_ROOT"].'/logs/20.txt',"w");
}
//register_shutdown_function('shutdown');
shutdown();
?>
opened tab and closed immediately after if completely loaded this code created 2.txt ... 10.txt so certainly there is an option which shuts down script after 10 secs