Built From Developers For Developers
» Kuikie.com » Snippets » JavaScript » Other » PHP. Execute Pseudocron Job After Web Page Has Loaded
  Categories
  JavaScript
    Ajax
    IFrame
    Integers
    Other
    Strings
 

PHP. Execute Pseudocron Job After Web Page Has Loaded

This PHP snippet shows how to execute a repetitive job, even if we don't have access to cron.

If your server does not support cron jobs, then you may need to use another way to replace the shortcoming. This is usually called pseudo cron. The snippet bellow shows how to call the pseudo cron script after the webpage has loaded. The snippet uses the JQuery library and Ajax to call the pseudo cron.

<script type="text/javascript">
    $(window).bind("load", function(){$.get("cron.php",function(data){})});
</script>
 
©2012 Sinevia Ltd Terms of Use         Privacy Policy Valid XHTML 1.0 Transitional