Send variable's data from a form to another form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Akemi K. Buxton

    Send variable's data from a form to another form

    Hi, I'm a new PHP user so struggling a lot.

    I know this is silly question for you but I'll appreciate if you can help
    me.

    Here is my code.

    I need to send the data of $Sname in form1 to $Sname in form3.



    #!/usr/local/bin/php
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <?
    if(!$_POST[vote]) {
    if(!$_POST[build]) {

    // form 1
    ?>
    <form method="POST" target="_blank" >
    <input name=Sname>
    <input type=submit name=build value="build the form">
    </form>
    <?
    }
    else
    {
    // form 2
    ?>
    <form method="POST" target="_blank" >
    <?
    echo $Sname;
    echo "<input type=submit name=vote value=vote>";

    mkdir($Sname,07 77);
    ?>
    </form>
    <?
    }}
    else
    {
    // form 3
    ?>
    <form method="POST">
    <?
    echo "$Sname";
    ?>
    </form>
    <?
    }
    ?>
    </body>
    </html>



  • Jon Kraft

    #2
    Re: Send variable's data from a form to another form

    "Akemi K. Buxton" <mikimon@verizo n.net> wrote:
    [color=blue]
    > I need to send the data of $Sname in form1 to $Sname in form3.
    >
    > // form 2
    > ?>
    > <form method="POST" target="_blank" >
    > <?
    > echo $Sname;[/color]

    echo "<input type=\"hidden\" name=\"Sname\" value=\"".$Snam e."\">";
    [color=blue]
    > echo "<input type=submit name=vote value=vote>";
    >
    > mkdir($Sname,07 77);
    > ?>
    > </form>[/color]

    HTH;
    JOn

    Comment

    Working...