REQUEST_METHOD vs REDIRECT_REQUEST_METHOD

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alex

    REQUEST_METHOD vs REDIRECT_REQUEST_METHOD

    I'm building a Resty interface and i'm trying to POST data from a web
    page via a normal web form with method="POST" in it's form tag.

    When i submit the data to my resource the variable
    $_SERVER["REQUEST_METHOD "] reports "GET" and there is a
    $_SERVER["REDIRECT_REQUE ST_METHOD"] which reports "POST".

    The resource pages are accessed using the apache 404 error page:

    - The web page gets the request (http://myserver/path/to/my/resource)
    - The url it's not found and the url string is parsed
    - The resource /path/to/my/respurce is checked
    - The resource data is returned

    So, do i have to use the REDIRECT_REQUES T_METHOD server variables
    instead of REQUEST_METHOD? ?

    Is it a reliable variable?? (i.e all web servers produce this variable
    when accessing a resource in this fashion)

    thanks,
    alex.
  • max.schulze@googlemail.com

    #2
    Re: REQUEST_METHOD vs REDIRECT_REQUES T_METHOD

    On Jun 12, 10:20 am, alex <m...@privacy.n etwrote:
    I'm building a Resty interface and i'm trying to POST data from a web
    page via a normal web form with method="POST" in it's form tag.
    >
    When i submit the data to my resource the variable
    $_SERVER["REQUEST_METHOD "] reports "GET" and there is a
    $_SERVER["REDIRECT_REQUE ST_METHOD"] which reports "POST".
    >
    The resource pages are accessed using the apache 404 error page:
    >
    - The web page gets the request (http://myserver/path/to/my/resource)
    - The url it's not found and the url string is parsed
    - The resource /path/to/my/respurce is checked
    - The resource data is returned
    >
    So, do i have to use the REDIRECT_REQUES T_METHOD server variables
    instead of REQUEST_METHOD? ?
    >
    Is it a reliable variable?? (i.e all web servers produce this variable
    when accessing a resource in this fashion)
    >
    thanks,
    alex.
    Global variables should ever be reliable! I think since PHP 5.1.6 you
    can trust them.
    If you work with redirection you should use the
    REDIRECT_REQUES T_METHOD.

    Comment

    • alex

      #3
      Re: REQUEST_METHOD vs REDIRECT_REQUES T_METHOD

      En/na max.schulze@goo glemail.com ha escrit:
      >
      Global variables should ever be reliable! I think since PHP 5.1.6 you
      can trust them.
      If you work with redirection you should use the
      REDIRECT_REQUES T_METHOD.
      I was not refering about reliable in a "security" sense but in:
      will the variable exist if someone uses the application under a IIS (for
      instance) instead of Apache.

      BTW, i learned the hard way that ErrorDocument redirection does not keep
      $_POST variables you sent, so i've got to redesign server configuration
      to use mod_rewrite which will make things easier for me.

      thanks anyways :)
      alex.

      Comment

      Working...