Sending post variable

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JÿGius³ vs ::NRG::ius

    Sending post variable

    Hi all.

    I have a script with a form

    <form action="a.php" ... method="post">
    <input name="field" ...>
    </form>

    a.php gets the variable with

    $a = $_POST['field'];

    How can I send $a to another script via POST?
    I have another script that needs some fields using POST.
    1) The user sends a form to a.php
    2) a.php adds some fields and sends all to another script using POST.

    With GET I would get

    header('Locatio n: b.php?k=h&newfi eld=' . $a);

    But with POST?

    Any ideas?

    G.



  • Ewoud Dronkert

    #2
    Re: Sending post variable

    On Wed, 11 May 2005 08:38:19 GMT, JÿGius³ vs ::NRG::ius wrote:[color=blue]
    > How can I send $a to another script via POST?[/color]

    Did you try google?! First hit:



    --
    Firefox Web Browser - Rediscover the web - http://getffox.com/
    Thunderbird E-mail and Newsgroups - http://gettbird.com/

    Comment

    • DJ Craig

      #3
      Re: Sending post variable

      You would be better to do this with session variables:


      Comment

      • R. Rajesh Jeba Anbiah

        #4
        Re: Sending post variable

        JÿGius³ vs ::NRG::ius wrote:
        <snip>[color=blue]
        > How can I send $a to another script via POST?[/color]

        As someone already pointed out you can mimic a HTTP POST using PHP.
        [color=blue]
        > With GET I would get
        >
        > header('Locatio n: b.php?k=h&newfi eld=' . $a);
        >
        > But with POST?[/color]

        POST redirection can be done with "303 See Other" HTTP status
        <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#c111 577953637573243 >,
        *AFAIK*. But, I never got that working.

        --
        <?php echo 'Just another PHP saint'; ?>
        Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

        Comment

        Working...