|
Posted by Paola on 09/26/14 11:25
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 ;)
--
Paola
Navigation:
[Reply to this message]
|