handling forms in PHP

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

Threaded View

Dear all,

I have a php script quering all fields in our business ldap server
(php5-ldap module). These fields are presented in a form (desired fields
to show) with checkboxes.
Now, from this form submit (desired fields), I want to go to another
form (sort form), that lets the user select a sort order (1st sort on
field A, 2nd sort on field B, ...).
My question is: has anyone a suggestion for 'best prectises' on using
forms? Should I check the submit of the 1st form and send it to a second
script page (with the sort form on it) OR should I set the action
attribute to load within the same scripting page
(action="$_SERVER["PHP_SELF"]") with some nested if the else loops?

Any experience or suggestions?

Many thanks in advance,


Re: handling forms in PHP

Zeff wrote:
Quoted text here. Click to load it

I find the use of one page more elegant because it results in lesser
file clutter while keeping the functionality compact.

Re: handling forms in PHP

On Tue, 14 Oct 2008 13:20:55 +0200,

Quoted text here. Click to load it

What would your users expect?  How do they think it works?

People explain to themselves what's going on, and it's internally
logical even if technically impossible.  If you can make it work
(on the surface) the way they think it will work, you're golden.

In the particular case you describe, I would start by putting
both the field selection and the sort selection on the same page,
if possible, and then displaying the result of their choices
below the selector section.  That way, if they don't like what
their choices produced, they have something to look at while
trying to choose differently.  So:  one page, for starters.

Site Timeline