SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru Angry Coder's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry How can I make sure dealing with $_REQUEST and $_SERVER vars is safe and portable?

    Hello,

    I am writing a PHP app that I'll distribute freely over the net... so I want to make sure that my dealing with $_GET, $_POST, $_SESSION, $_REQUEST, ... is safe and portable that works with any PHP version & configuration?

    How can I do that?

    Your help is truly appreciated.
    Why It Doesn't Work?!

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Provide a disclaimer that states that the person who installs the software needs to have PHP configured not to use global variables (for their own safety) because the $_GET, $_POST, $_SESSION, etc. are always available and are the safest way to get form fields, etc.

    If someone has global variables enabled but your software uses the system variables all the time then you are safe and so are the variables.

  3. #3
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Superglobals were first introduced in php version 4.1. You have to mention this version as a minimal (not too restrictive imho ) requirement in your readme file.

  4. #4
    SitePoint Guru Angry Coder's Avatar
    Join Date
    May 2002
    Location
    Canada
    Posts
    599
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But vBulletin is not doing that!

    It supports almost any configuration
    Why It Doesn't Work?!


Bookmarks

Posting Permissions

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