Form Validation Query

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a form on my website
( ). When the user
submits the form various validation checks are completed by another PHP
script. If any of these fail, the user is redirected back to the form.
The content that they submitted is retained and sent back in the URL
and picked up by another script and inserted into the fields.

My problem is with memo fields as this method of returning the data
seems to chop off anything after the first newline or carriage return.

I presume it would be better to POST this information back but how do I
do this from PHP without a SUBMIT button???

Many thanks for your continued help.

Hope all that makes sense - see the website which should clarify the

p.s. the &frm=3~4 in the link simply ensures that my name appears in
"TO" box so if you test the script spurious messages don't go to my

Re: Form Validation Query wrote:
Quoted text here. Click to load it

You probably want to use Sessions here. At the top of each file insert
"session_start()" as the first PHP statement.

Instead of putting the information into the URL, create a SESSION
variable for each variable you need to send back.

$_SESSION['form_field'] = $_POST['form_field'];

Then in the program that redisplays the form, use the value in the
session variable.


Re: Form Validation Query

I noticed that Message-ID: contained the following:

Quoted text here. Click to load it

I'm not sure of the answer, mainly because I never do it this way.  It's
perfectly possible to do this with a single page, in which case the
problem simply does not occur, since you have the post data to refill
the fields.

Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs /

Re: Form Validation Query

Thanks - but for various reasons I would prefer to keep the validation
in a  separate script (related to the way I've constructed the site -
using a bespoke CMS).

Site Timeline