RE: Session and validation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You might consider another approach, if you are using php5.  It's called
PRADO, I believe it was overall winner of the PHP programming contest
sponsored by ZEND.

http://www.zend.com/php5/contest/contest.php?id=36&single=1

This is how the product is described;

-------------------------------- snip---------------
PRADO is an event-driven and component-based framework for Web application
development in PHP5. 

Developing a Web application with PRADO mainly involves instantiating
prebuilt and application-specific component types, configuring them by
setting their properties, and composing them into application tasks. Some
repetitive and tedious work, such as form field validation and page state
management, can be accomplished easily in this fashion with the provided
PRADO components. Using PRADO to develop Web application will bring you
familarity of developing desktop GUI application with RAD tools such as
Borland Delphi, Visual Basic, etc. You will also find it is like ASP.NET in
many aspects. 
--------------------------------- snip---------------

I haven't tried this myself, but it looks like it may be geared to what you
are seeking.  Much of the rave seems to be it's event driven nature (unusual
for web apps).  I hope to be using it myself in the next few months.  If the
reviews are any clue, I would expect it to become part of a future release
of PHP.  Time will tell.

Warren Vail


-----Original Message-----
From: Pablo Gosse [mailto:gossep@xxxxxxx] 
Sent: Friday, October 29, 2004 4:23 PM
To: Stuart Felenstein; php-general@xxxxxxxxxxxxx
Subject: RE:  Session and validation


[snip]
I had this thread going yesterday.  Then basically
think it reached a stalemate.  I'm wondering has
anyone setup forms using session variables and
validation.  Validation where the validating is done
on the same page, and the redirected on success ?
[/snip]

You need a class which will generate and validate your forms dynamically.
Pear provides two packages (the second an extension of the
first):

http://pear.php.net/package/HTML_QuickForm
http://pear.php.net/package/HTML_QuickForm_Controller

I've never used these as I wrote my own library to handle this a few years
ago, but from what I understand these two packages will do the trick.

Basically it will work thusly:

1)  On a page where you need a form, you declare a new form object, specify
all your inputs, how they should be validated, etc., and these are then
stored in the session.

2)  On the receiving page you call the form validation object, passing in an
identifier for which form should be validated.

3)  If it validates your script will continue unfettered, else it will
update the values in the session with the appropriate error message and
redirect you back to the original form, which, since you are using session
variables to display the inputs, will now be updated with the error
messages.

HTH,
Pablo

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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux