|
-
Aug 17th, 2006, 04:01 AM
#1
Thread Starter
Addicted Member
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
-
Aug 17th, 2006, 04:33 AM
#2
Retired VBF Adm1nistrator
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
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Aug 17th, 2006, 04:35 AM
#3
Re: 24Hour reset code
- Cronjob
- PHP: Directory Functions
php.net should be your first port of call, as with MSDN for Microsoft languages.
-
Aug 17th, 2006, 04:58 AM
#4
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
-
Aug 17th, 2006, 06:29 PM
#5
Thread Starter
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|