views:

194

answers:

2

I'm new to PHP and before I waste a lot of time doing things the hard way, I wanted to find out if there are shortcuts/techniques to creating PHP web forms apps. All this app will do is display web forms with data from 1 or more tables. In addition to displaying data, the user must be able to update the form and add new data to the forms. I know how to to do all this by manually writing all the PHP/HTML code. But I'm looking for anything that can save me time.

Unfortunately, I can't use any of the fancy PHP libraries such as CakePHP for this. I'm restricted to using the core PHP framework, Oracle for the database and the OCI library for Oracle access.

Given these constraints, what the easiest way to support CRUD operations in a basic PHP forms app? Are there code generators or other tools that can help?

+3  A: 

Unfortunately, I can't use any of the fancy PHP libraries such as CakePHP for this. I'm restricted to using the core PHP framework,

Most PHP frameworks are written in PHP. So you wouldn't have to install anything to use them.

That said, forms are rather non-trivial. Treating a form as a separate component only works to some extend. Because of that, many frameworks have forms deeply integrated into them, and not as a standalone component.

You could take a peek at Zend Framework's Form component. It's fairly self-sufficient and feature-rich.

troelskn
As a further note, even if you don't think that you can actually use a framework, you can always look at a framework like Zend for ideas on how to build your own.
Noah Goodrich
A: 

I build all of my forms on top of a "fillInFormValues($html, $request, $formErrors);" function. See my article at OnLamp for details and full source code.

gavinandresen
Kind of a neat and unique approach, but doesn't this produce unnecessary overhead (memory and processing time)? Wouldn't it be better just to have value="<?=$Value?>"?
tj111