php sticky forms

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

    php sticky forms

    Hello,
    Ok, i'm missing something probably very simple. I want to have some
    forms that are sticky, a user fills one out then is given a personalized
    thank you message on the next page and the Email is mailed to an admin, or
    any fields marked as required are indicated and the user must fill out that
    information. This should retain the previously entered correct data and the
    user need not press the back button.
    Thanks.
    Dave.


  • Geoff Berrow

    #2
    Re: php sticky forms

    I noticed that Message-ID: <tga1c.86$8G3.3 7@fe2.columbus. rr.com> from
    dave contained the following:
    [color=blue]
    >Ok, i'm missing something probably very simple. I want to have some
    >forms that are sticky, a user fills one out then is given a personalized
    >thank you message on the next page and the Email is mailed to an admin, or
    >any fields marked as required are indicated and the user must fill out that
    >information. This should retain the previously entered correct data and the
    >user need not press the back button.[/color]

    I have one that does that.



    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Alvaro G Vicario

      #3
      Re: php sticky forms

      *** dave wrote/escribió (Wed, 03 Mar 2004 01:10:49 GMT):[color=blue]
      > Ok, i'm missing something probably very simple. I want to have some
      > forms that are sticky, a user fills one out then is given a personalized
      > thank you message on the next page and the Email is mailed to an admin, or
      > any fields marked as required are indicated and the user must fill out that
      > information. This should retain the previously entered correct data and the
      > user need not press the back button.[/color]

      Just loop through the very same page until form is correctly filled:


      if form is ok
      redirect to thank page
      else
      print form



      Form could look this way:

      <form action="<?=$_SE RVER['PHP_SELF']?>" method="post">
      <input type="text" name="foo" value="<?=addsl ashes($_POST['foo'])?>">
      </form>

      --
      --
      -- Álvaro G. Vicario - Burgos, Spain
      --

      Comment

      • Rudolf Horbas

        #4
        Re: php sticky forms

        Alvaro G Vicario wrote:
        [color=blue]
        >(...)
        > Form could look this way:
        >
        > <form action="<?=$_SE RVER['PHP_SELF']?>" method="post">
        > <input type="text" name="foo" value="<?=addsl ashes($_POST['foo'])?>">
        > </form>[/color]

        Shouldn't it be <?=strip_tags($ _POST['foo'])?>?

        Or, better:
        <?=htmlentities ( stripslashes($_ POST['foo']) )?>

        addslashes() is only if You're passing the form content to a database
        and can be rather annoying otherwise ;-)

        Rudi

        Comment

        • dave

          #5
          Re: php sticky forms

          Hello,
          Thanks to everyone who offered suggestions, i got my sticky form.
          Dave.


          Comment

          • Alvaro G Vicario

            #6
            Re: php sticky forms

            *** Rudolf Horbas wrote/escribió (Wed, 03 Mar 2004 19:07:09 +0100):[color=blue]
            > Shouldn't it be <?=strip_tags($ _POST['foo'])?>?[/color]

            What's wrong with using < and > inside quotes:

            <input type="text" value="Hello <World>!">
            [color=blue]
            > <?=htmlentities ( stripslashes($_ POST['foo']) )?>
            >
            > addslashes() is only if You're passing the form content to a database
            > and can be rather annoying otherwise ;-)[/color]

            You're right, I made a big typo :)


            --
            --
            -- Álvaro G. Vicario - Burgos, Spain
            --

            Comment

            Working...