how can I use request parameters without using $_REQUEST

Discussion in 'PHP' started by jawednazarali, Dec 1, 2007.

  1. #1
    how can I use request parameters without using $_REQUEST i.e.

    let say I have a prameter FName passed in request and I want to use it in my php file but I don't want to use $_REQUEST object, I just want to use it as $FName, is this possible?

    regards,
    Jawed Ali
     
    jawednazarali, Dec 1, 2007 IP
  2. And1984

    And1984 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I assume you also don't want to take $_POST / $_GET ?
    I dont know any other method but I know that just using $FName to get your request parameters is switched off by most hosters for security reasons.

    regards,
    A.

    Edit:
    Oops sry, I think I misunderstood you ^^
    derek is right.
     
    And1984, Dec 1, 2007 IP
  3. derek34

    derek34 Guest

    Messages:
    34
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    of course. but you would have to use the $_REQUEST option once. You just create a variable called $ Fname and then assign the $_REQUEST['id or name'] to that variable. So like
    $Fname = $_REQUEST['id or name'];
    PHP:
    Then you wouldn't have to keep using the $_REQUEST all the time. Or if you didn't want to use the request comman at all, there's always $_GET or $_POST.
    Hope that answers your question...
     
    derek34, Dec 1, 2007 IP
  4. mvl

    mvl Peon

    Messages:
    147
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can use extract() to do this, but use it wisely. The extract() function can overwrite current variables and your script can be compromised.

    The EXTR_SKIP parameter makes sure existing variables don't get overwritten
     
    mvl, Dec 1, 2007 IP
  5. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #5
    If you have access to your php.ini file you can switch Register Globals On. This isnt advised though.
     
    tonybogs, Dec 2, 2007 IP
  6. Kwaku

    Kwaku Well-Known Member

    Messages:
    1,217
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    140
    #6
    Kwaku, Dec 2, 2007 IP