Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Passing objects as post data...


Message #1 by patrick.scheuerer@g... on Thu, 4 Jul 2002 11:09:34
>>What exactly are you trying to achieve?

I wrote a Category and a File class (i'm developing a support area for a 
website and the people should want to upload new files...).
So what I'm trying to accomplish is, instead of passing all the form 
fields as separate variables, create an File/Category object and 
initialize it with the contents of the form. It should then be passed on 
to a preview page where the user can verify his input. if everything is 
correct the record is written to the database. if there are errors the 
user is taken back to the form to make the necessary changes...

I'm new to PHP and I mainly used Java so far, so I'm really used to 
working with objects.

I just like the OO approach better... i also wrote a check() and save() 
method (or member function, I don't know the proper expression for PHP) 
for each of the classes. check() validates the user data that was entered 
and save() writes the whole thing to the DB.

Does this make sense to anybody???

Cheers, Patrick

  Return to Index