-
24Hour reset code
is there a way i can make PHP run a piece of code every 24 hours without there being any sort of user interaction?
and is it possible to make/rename a directory in php?
im sry about asking without having tried first, but everytime i search for something it doesnt give me the proper things, i think its my searching terms :)
cheers in advance :)
-
Re: 24Hour reset code
You'd probably have to run a service on the server in particular.
If it's a Windows server, use a Windows Service with a Timer or Scheduled Tasks.
If it's a *nix server, use a crontab
-
Re: 24Hour reset code
- Cronjob
- PHP: Directory Functions
php.net should be your first port of call, as with MSDN for Microsoft languages.
-
Re: 24Hour reset code
PHP scripts can be run standalone without the aid of a web server using the Command Line Interpreter (CLI).
You can use a cron job on UNIX and the Task Scheduler in UNIX. Remember topay attention to the user ID under which you run the script. Also remember that environment variables related to the server will not be present.
Unix:
PHP Code:
#!/path/to/php/cli/php-cli
<?php
echo ("hello world");
?>
Windows command line:
Code:
> \path\to\php.exe /path/to/file.php
-
Re: 24Hour reset code
cheers guys :) didnt think it would be that easy :) and ive now bookmarked php.net so i dont have to be so newby ;)