Fix PHP scripts - excellent coder needed

Discussion in 'PHP' started by sames1, Apr 14, 2008.

  1. #1
    I have a few little scripts that basically pull data from a database and put it on page. They worked fine at my old host, but were not set up to have globals turned off.

    Now on my new host they don't work so well. I need them fixed. It's a small job I know, but I'm a dummy.
     
    sames1, Apr 14, 2008 IP
  2. vishnups

    vishnups Banned

    Messages:
    166
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Please note that register_globals in php.ini are turned off by default in PHP 5 as it poses security risks. I have send you a PM with details.
     
    vishnups, Apr 15, 2008 IP
  3. CreativeClans

    CreativeClans Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You might put extract($_REQUEST); at the top of your script.
    An easy solution, but of course it means the security risks that come with register globals ON are back again. There is a reason they decided to make OFF the default.

    The other, more secure, way (though it means more work) is defining explicitaly in your script all variables passed by the globals.
    For example:
    $variable = $_POST['variable'];
     
    CreativeClans, Apr 15, 2008 IP