passing the POST to a php file

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

    passing the POST to a php file

    Hi,
    I've an HTML form (contains 2 controls: input1 and input2) that call a php
    file (file1.php) using the post method.
    I need to call (from file1.php) another php file file2.php and pass the POST
    information to it so I can get the information in the $_POST array in
    file2.php.
    How can I do it?

    Thanks.


  • Shawn Wilson

    #2
    Re: passing the POST to a php file

    toufik toufik wrote:[color=blue]
    >
    > Hi,
    > I've an HTML form (contains 2 controls: input1 and input2) that call a php
    > file (file1.php) using the post method.
    > I need to call (from file1.php) another php file file2.php and pass the POST
    > information to it so I can get the information in the $_POST array in
    > file2.php.
    > How can I do it?[/color]

    Search PHP.net for sessions. Use the $_SESSION array.

    Shawn
    --
    Shawn Wilson
    shawn@glassgian t.com


    I have a spam filter. Please include "PHP" in the
    subject line to ensure I'll get your message.

    Comment

    • Matt

      #3
      Re: passing the POST to a php file

      On Tue, 13 Jan 2004 10:26:46 -0500, toufik toufik <toufiki@sympat ico.ca>
      wrote:
      [color=blue]
      > Hi,
      > I've an HTML form (contains 2 controls: input1 and input2) that call a
      > php
      > file (file1.php) using the post method.
      > I need to call (from file1.php) another php file file2.php and pass the
      > POST
      > information to it so I can get the information in the $_POST array in
      > file2.php.
      > How can I do it?
      >
      > Thanks.
      >
      >[/color]

      Thats actually available through the $GLOBALS['HTTP_POST_VARS '] array.

      --
      Matt

      Comment

      • adamt

        #4
        Re: passing the POST to a php file

        On Tue, 13 Jan 2004 10:26:46 -0500, toufik toufik wrote:
        [color=blue][color=green]
        >> I need to call (from file1.php) another php file file2.php and pass the POST[/color]
        > information to it so I can get the information in the $_POST array in
        > file2.php.
        > How can I do it?
        >[/color]

        If you have an input thing called 'input1', and another called 'input2',
        say something like:

        <input type="textarea" name="input1" />

        Then, you should be able to retrieve the contents of input1 by calling

        $_POST['input1']

        So, something like:

        <?
        echo $_POST['input1'];
        ?>


        Comment

        • Ravi_at_WebmasterInABox.net

          #5
          Re: passing the POST to a php file

          At the end of file1.php, you can do a redirect to
          file2.php and attach the post variables as GET variables.

          <? header ("Location: file2.php?var1= ".$var1."&var2= ".$var2); ?>

          Hope this helps.

          Ravi
          Founder & Software Architect




          "toufik toufik" <toufiki@sympat ico.ca> wrote in message news:<T6UMb.950 9$881.1354822@n ews20.bellgloba l.com>...[color=blue]
          > Hi,
          > I've an HTML form (contains 2 controls: input1 and input2) that call a php
          > file (file1.php) using the post method.
          > I need to call (from file1.php) another php file file2.php and pass the POST
          > information to it so I can get the information in the $_POST array in
          > file2.php.
          > How can I do it?
          >
          > Thanks.[/color]

          Comment

          Working...