RE: Prefilled forms(solved)
| From: | Veress Berci | Date: | Thu, 20 Nov 2003 14:47:17 +0000 |
| Subject: | RE: Prefilled forms(solved) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-170419@lists.php.net to get a copy of this message | ||
> -----Oorspronkelijk bericht-----
> Van: Eugene Lee [mailto:list-php-1@fsck.net]
>
> On Thu, Nov 20, 2003 at 11:22:02AM +0200, Veress Berci wrote:
> :
> : Scuse me, if I write some totally dumb thing.
> : I am quite new to PHP and programming, and maybe I'm not understanding
> : the question, but:
> :
> : What if you assign a value to every form field like this:
> :
> : <input type="text" name="something" value="<?php echo
> $something; ?>">
> :
> : or - safer, with register_globals off:
> :
> : <input type="text" name="something" value="<?php echo
> $_POST['something'];
> : ?>">
>
> Actually, you can do one more thing:
>
> <input type="text" name="something" value="<?php echo
> htmlentities($_POST['something']); ?>">
>
> : Again, please apologize, if i'm stupid.
>
> Ummm, what is the question? :-)
I didn't try to ask a question, i tried to answer one:
b b wrote:
> Problem:
> I am running apache/php server. If I populate a form,
> send it and then click back I see a blank form.
>
> Solution:
> I had some prefilled form elements where I set the
> value of such form element. For example I had
> input type = "hidden" VALUE="whatever" ... at the
> beginning of the form.
>
> when I took that hidden variable out and had it at
> the end of the form after all the other elements I the
> problem was solved. Actually any element with its
> value preset should go to the end of the form. In that
> case when I hit back my form was prefilled the way I
> submitted it.
I was triing to find a solution to this question:
What can I do, if I don't want my form to be blank if I click the Back
button?