Jump to content

Running a php code


etrader

Recommended Posts

I want to run a php file which contains a long process and takes time. If I simply run the file on browsers, the process will be interrupted by any perturbation in the internet connection or closing the browser. How I can force the php process to continue running without connection to my local PC (server side controlling)? I am looking for something like what cron job does (but only one time, not periodically).

Link to comment
Share on other sites

there really isn't a one time.. with anything automated.

 

You can however build a function that through the use of a cron will run or not run.. think of a light switch. you set the cron to a weekly event since you really only want it once per say. then in the script the cron would call to you you would in a crude concept wrap the over all task you want done in an if-else-then type of statement. If this variable == on, then run my function.. if its off just ignore it. If it ignores it then nothing happens if it doesnt it runs the function. either way it happens without the need of intervention from you and your browser, and actually may run quicker in the end game as it doesnt have to load up in a browser as well.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.