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------------------------------------------------

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:42:08
Script start
Timing: Jan 18 2025 11:42:08
Module start 'layout'
Timing: Jan 18 2025 11:42:08
Module start 'content'
Timing: Jan 18 2025 11:42:09
Module end 'content'
Timing: Jan 18 2025 11:42:09
Script end

Main resources:

Total runtime0.5936 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0131 587.9063152.6250
Module start 'layout' 0.01310.0057 740.531339.4453
Module start 'content' 0.01870.5736 779.9766521.5391
Module end 'content' 0.59230.0013 1,301.51568.3203
Script end 0.5936  1,309.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.6289160.0002
Check MTime0.00140.2288160.0001
Mysql Total
Database connection0.00110.181610.0011
Mysqli_queries0.542591.3864540.0100
Looping result0.00050.0816520.0000
Template Total0.549692.620.2748
Template load0.00220.368920.0011
Template processing0.547492.212020.2737
Template load and register function0.00030.050710.0003
states
state_id_array0.00150.259710.0015
state_identifier_array0.00100.174320.0005
Override
Cache load0.00180.3024130.0001
Sytem overhead
Fetch class attribute can translate value0.00100.164220.0005
Fetch class attribute name0.00100.163630.0003
XML
Image XML parsing0.00070.123620.0004
class_abstraction
Instantiating content class attribute0.00000.001230.0000
General
dbfile0.00100.1658170.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs