pro_php thread: Passing objects as post data...
>>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