PHP and Cron Question

Discussion in 'PHP' started by wendallb, Jun 18, 2007.

  1. #1
    Hello.

    Is there a way to turn register globals on and off via the htaccess file and what is the code??

    Also I need the proper cron code to dump a mailbox once a day such as:

    linux dump /home/website/inbox/????

    Thanks for the help in advance!

    WendallB
     
    wendallb, Jun 18, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    php_flag register_globals 0
    Code (markup):
    Requires PHP running as an Apache module.

    Not so sure about the cron. evoleto, below, has the code for having it run every day at midnight if that's all you wanted.
     
    krt, Jun 18, 2007 IP
  3. Evoleto

    Evoleto Well-Known Member

    Messages:
    253
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #3
    As about the crontab line, I don't understand exactly what you want to do, just adjust the command if I'm wrong:

    
    0 0 * * * rm -rf /home/website/inbox/*
    
    Code (markup):
     
    Evoleto, Jun 18, 2007 IP
  4. wendallb

    wendallb Active Member

    Messages:
    180
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    78
    #4
    Evoleto,

    Thanks, I have an email box on my domain that catches junk emails and I want a Cron to dump that box once a day. It is the inbox.

    Also you wrote [php_flag register_globals 0] is that on or off??

    Thanks Again,

    WendallB
     
    wendallb, Jun 18, 2007 IP
  5. Lemezo

    Lemezo Active Member

    Messages:
    429
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #5
    Why would you want to turn off globals ?
     
    Lemezo, Jun 18, 2007 IP
  6. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #6
    Having register_globals set to on makes it much easier for scripts to be exploited. It doesn't necessarily make php more vulnerable, but many people's coding practices become insecure when register globals are on.

    One of the easiest way's to exploit it would be by setting a real variable with a $_GET variable. With register globals on, a user can create variables that should not be set, unless they are specifically initialized within a script (initializing them first, would prevent register globals exploits).

    http://www.php.net/register_globals shows a few examples of register globals exploits near the top of the page.
     
    jestep, Jun 18, 2007 IP