Forums / General / How do I embed a php form??

How do I embed a php form??

Author Message

Neo Racer

Wednesday 16 August 2006 6:52:24 am

I have a php form that needs to go into an EZ publish page. Is it possible to embed it like a picture or is it more complicated than that??

Please help :s

Nate Parsons

Wednesday 27 September 2006 1:18:31 pm

Yo Neo,

Sadly it's more complicated than that. EzPublish doesn't offer any mechanism for quickly dumping your own PHP code into templates. You'd probably be best off building your own module for your form using the "extension / plugin" system.

EzPublish does come with the ability to create it's own basic forms by using the data collector switch in the class attributes of your "form class." I.E. you could make a new class with the fields you need for your form, mark them as information collectors, and ezpublish would then accept them in. If you wanted you could then run a cron or something to grab that data out of the ezpublish DB every so often. This way is a lot less clean & not event driven, but would be fairly quick & dirty compared to writing your own module... That being said writing your own module isn't that bad, probably take you 4-8 hours your first time.

one third option might be to setup another extension as php parsable and adding that to the apache rewrite rules as a file extension to ignore. Then you could just have a normal php page in your site called like myform.form or something. Note that you'd have to copy and paste the header & footer graphics in there yourself if you went this route.

Anyhow, I hope this helps!
-nate

---------------------------------------------------------------------------------
I look forward to an America which will not be afraid
of grace and beauty.

-------------JFK 10/26/63------------------------------------------------