|
Posted by Tyrone Slothrop on 10/10/29 11:25
On Wed, 31 Aug 2005 11:36:54 GMT, "Paola" <scarel@libero.it> wrote:
>Hi, my problem:
>
>example:
>-----
><form action="<?=$_SERVER['PHP_SELF']?>" method="post" name="form1">
><input type="text" value="<?echo ($postedTitle) OR (the content of the title
>field in the database)?>" name="title"> <?= $err_msg?> //required field
><input type="text" value="<? echo ($postedMsg) OR (the content of the
>message field in the database) ?>" name="title"> //no required field
>
><input type="submit" value="submit changes">
></form
>/-----
>
>After a submit, first of all I make a control on the required fields: "if"
>the field is empty some error message will appear.. "else" the application
>will update the record on the database.
>
>THE PROBLEM: if the field is empty I need to show the form again, but all
>the fields should be filled.. if they were changed before the submit.. with
>the new text entered! As usual. BUT, if I have insert for example a " ' "
>the field will be filled with " \' " ... IF " \ " then " \\ "
>If I submit the form again and there are some more errors... \\ becomes \\\
>and \\\\ and so on...
>
>what is the best way.. without using javascript.. to remember the content of
>a field?
>
>Could some one help me, please? Thank you very much..
>
>p.s. I'm sorry for my english is not perfect ;)
http://us3.php.net/manual/en/function.urlencode.php
The format of the posted values would be:
<input type="text" name="field"
value="<?=urlencode($_POST['field'])?>">
[Back to original message]
|