sticky form with multiple fields

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

    sticky form with multiple fields

    how do i create a sticky form with multiple fields? say
    i want a form with:

    name: [input field name]
    address: [input field address]
    country: [input field country]

    [submit button]

    and if a user presses the submit button it will show
    exactly the same page with the fields that the user
    has entered filled in with the values (s)he entered
    (validation of the values will come later), and the
    info of the form sent.

    should i name all the values in the form separately
    or should i use an array?

    anybody got a simple example?

    mike


  • Duyet The Vo

    #2
    Re: sticky form with multiple fields

    Something like this ?
    ===== form_check.php =====
    <html>
    <body>
    <font face="Verdana" size="2">
    <?php
    $debug = true;

    $Inarray = $_POST['Inarray'];
    $button = trim ( $Inarray['button'] );

    if ( ! IsSet ( $button ) || $button != "Submit" )
    {
    $name = "";
    $email = "";
    }
    else
    {
    // Data Submitted
    $name = $Inarray['name'];
    $email = $Inarray['email'];

    if ( $debug )
    {
    echo "Name = $name<br>\n";
    echo "Email = $email<br>\n";
    echo "Button = $button<br>\n";
    } // end if ( ...

    // Code handling these stuff
    }

    ?>


    <form action="<?php echo $self; ?>" method="post">
    <table border='0'>
    <tr>
    <td><img src="images/space.gif" height='1' width='100'></td>
    <td valign='top'><b >Name</b></td>
    <td valign='top'>&n bsp;
    <input name="Inarray[name]" value="<?php echo "$name"; ?>"
    size="60"><br>
    </td>
    </tr>

    <tr>
    <td><img src="images/space.gif" height='1' width='100'></td>
    <td valign='top'><b >Email</b></td>
    <td valign='top'>&n bsp;
    <input name="Inarray[email]" value="<?php echo "$email"; ?>"
    size="60"><br>
    </td>
    </tr>
    <tr>
    <td><img src="images/space.gif" height='1' width='100'></td>
    <td colspan='2' align='center' valign='top'>
    <input type="submit" name="Inarray[button]" value="Submit">
    <img src="images/space.gif" height='1' width='20'>
    <input type="reset" name="Inarray[button]" value="Clear">
    </td>
    </tr>
    </table>

    </form>
    </font>

    </body>
    </html>


    "michael nieuwenhuizen" <usenet@mikkie. net> wrote in message
    news:1023te393l kbae1@corp.supe rnews.com...[color=blue]
    > how do i create a sticky form with multiple fields? say
    > i want a form with:
    >
    > name: [input field name]
    > address: [input field address]
    > country: [input field country]
    >
    > [submit button]
    >
    > and if a user presses the submit button it will show
    > exactly the same page with the fields that the user
    > has entered filled in with the values (s)he entered
    > (validation of the values will come later), and the
    > info of the form sent.
    >
    > should i name all the values in the form separately
    > or should i use an array?
    >
    > anybody got a simple example?
    >
    > mike
    >
    >[/color]


    Comment

    • Chung Leong

      #3
      Re: sticky form with multiple fields

      header("HTTP/1.1 204 No Content");
      exit();

      Uzytkownik "michael nieuwenhuizen" <usenet@mikkie. net> napisal w wiadomosci
      news:1023te393l kbae1@corp.supe rnews.com...[color=blue]
      > how do i create a sticky form with multiple fields? say
      > i want a form with:
      >
      > name: [input field name]
      > address: [input field address]
      > country: [input field country]
      >
      > [submit button]
      >
      > and if a user presses the submit button it will show
      > exactly the same page with the fields that the user
      > has entered filled in with the values (s)he entered
      > (validation of the values will come later), and the
      > info of the form sent.
      >
      > should i name all the values in the form separately
      > or should i use an array?
      >
      > anybody got a simple example?
      >
      > mike
      >
      >[/color]


      Comment

      Working...