$_REQUEST problem

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

    $_REQUEST problem

    Hi,
    I've a variable that can come with the GET and POST method, So I use
    $_REQUEST to get it
    When I use a simple href
    href="myFile.ph p?myVar=value"
    I have myVAr in the $GET and $_REQUEST arrays.

    But when I pass throw a javascript function (to do some checks before to
    call php)
    href="javascrip t:myJsFunction( 'myFile.php?myV ar=value','');"

    and here is the javascript code
    function myJsFunction(ph pAction)
    {
    /// code for checks
    document.forms[0].action=phpActi on;
    document.forms[0].submit();
    }
    I have myVar in $_GET but not in the $_REQUEST array
    How can I have it in the request array
    Any help please.


  • Guest's Avatar

    #2
    Re: $_REQUEST problem

    > I have myVar in $_GET but not in the $_REQUEST array[color=blue]
    > How can I have it in the request array
    > Any help please.
    >
    > [/color]

    You need to make myVar=value a form variable such as:

    <input type="hidden" name="myVar" value="value">

    In your Js function you would set the value like so:
    document.forms[0].myVar.value="v alue";

    _______________ _______________ ______
    Wil Moore III, MCP | Integrations Specialist | Senior Consultant
    Business | Personal

    Comment

    Working...