HI
I want when somebody comes to my site and go out from it , a certain page still execute by the server and continue to do it's work.
Is it possible to execute some codes after the user close it by the server ?
Thanksv

a couple ways to do this would be to

1) Good way: Call a system command with php http://php.net/manual/en/function.system.php

2) Better way: Save a file to the server in your php script. Have a cron job check for that file, if it exists, run the command. This is a better way as you don't have to deal with time out issues.

cron jobs?

cron jobs?

Scheduled executions of commands, on a Unix based system.
The Windows equivalent would be the Task Scheduler.

I would have to agree with kireol.
If you want something done without an outside request, it is usually best to schedule it using Cron.

Thanks all,But my host doens't support cron.Is there any other solution for it or something like cron?

-move to a host that supports cron or task manager

-try system command and see if that will work for you


or
-use a different server to process what you need to run that does support cron/task mgr

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.