Results 1 to 5 of 5

Thread: 24Hour reset code

  1. #1

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    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

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359

    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]

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: 24Hour reset code

    1. Cronjob
    2. PHP: Directory Functions


    php.net should be your first port of call, as with MSDN for Microsoft languages.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width