On Sat, 2007-03-10 at 11:47 -0800, Don Don wrote:
> Hi all, i am building a system using php and am trying to separate
> the html codes from the php codes (i.e. placing them in separate
> files), I am from the java struts/spring background and seem to be
> finding it difficult doing that at the moment with php.

Just because they're in separate files doesn't mean they need to be in
separate requests.

> I've got a registration form in html with the action pointing to a
> separate php file that will process the form when submitted.

You have it ass backwards. You generally want an registration form in
html that has an action targetting itself and upon submission the
handling code is called.

> when i > want to output errors or messages, its currently being
> outputed in the resulting code generated by the php file.  What i
> would like is to return to the html page and display the messages
> there.

This is why you want to submit to the same page as the form is
displayed, in the event of an error you just redisplay the form and the
errors are already populated for you to print.

On the other hand if the form is submitted correctly then you redirect
to a nice little success page. This way you won't need to do error
message juggling via the session data.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to