Forums / Developer / Can EZ post the form data in different modules?

Can EZ post the form data in different modules?

Author Message

zfirst zlast

Saturday 03 January 2009 11:16:20 pm

Hi all, there is a donate page in my site, and i want followings:

1. When client filling up the form, in the custom module, save the client's information into my own table in DB( or make ez send me an email )
2. Then re-post the form to another module( in this custom module, i may need to do some more processing for the data ), then fetch a total tpl.

I have created a custom module, and have finished item one, it save information successfully, but when i want to re-post the data to another module, i got stuck. i knew a method to pass parameters in modules, and tried to use

$Module->redirectionURIForModule($module, $viewName, $parameters = array(), $unorderedParameters = null, $userParameters = false, $anchor = false);

But, it seems that all the userParameters will listed in the url.

I think i just want to know after processing data post from a page in a custom module, how to post the data to another custom module, just "POST" not send data. Could anyone help me? Any suggestions are also welcome, thank you.

Heath

Saturday 03 January 2009 11:49:43 pm

You may need to write a custom php module to re-post the forum submitted to it to another module. You might want to look at the following function, <i>http://www.php.net/manual/en/class.httprequest.php</i>

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

kracker (the)

Sunday 04 January 2009 12:07:44 am

<smirk /> Some of us could use to learn from this exploit's use of the httpRequest object to submit a form from an eZ publish module view. Enjoy ....

From: <i>http://www.astalavista.com/index.php?section=exploits&cmd=details&id=7599</i>

$post_fields = array(
				'ContentObjectAttribute_data_user_login_30' => $ARG[u],
				'ContentObjectAttribute_data_user_password_30' => $ARG[p],
				'ContentObjectAttribute_data_user_password_confirm_30' => $ARG[p],
				'ContentObjectAttribute_data_user_email_30' => $ARG[e],
				'UserID' => '14',
				'PublishButton' => '1'
			);
			
		$headers = array(
		    'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
		    'Referer' => $ARG[s]
		);

		$res_http = new HttpRequest($ARG[s]."/user/register", HttpRequest::METH_POST);
		$res_http->addPostFields($post_fields);
		$res_http->addHeaders($headers);

		$response = $res_http->send()->getBody();

Cheers, <i>//kracker

Sole & The Skyrider Band,
http://www.youtube.com/watch?v=Yoyp7NhiG70</i>

Member since: 2001.07.13 || http://ezpedia.se7enx.com/

zfirst zlast

Sunday 04 January 2009 2:20:37 am

Hi Heath and kracker, thank you for the helps, i have got it : )

Heath

Sunday 04 January 2009 4:43:05 am

Congratulations!

Cheers,
Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

eZ debug

Timing: Jan 18 2025 11:08:15
Script start
Timing: Jan 18 2025 11:08:15
Module start 'content'
Timing: Jan 18 2025 11:08:16
Module end 'content'
Timing: Jan 18 2025 11:08:16
Script end

Main resources:

Total runtime0.7666 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 587.8438180.8125
Module start 'content' 0.00500.6153 768.6563613.6016
Module end 'content' 0.62030.1462 1,382.2578337.3672
Script end 0.7664  1,719.6250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00380.4974210.0002
Check MTime0.00140.1867210.0001
Mysql Total
Database connection0.00060.074910.0006
Mysqli_queries0.683889.20652020.0034
Looping result0.00220.28172000.0000
Template Total0.738496.320.3692
Template load0.00220.287520.0011
Template processing0.736296.034320.3681
Template load and register function0.00020.021910.0002
states
state_id_array0.00100.135910.0010
state_identifier_array0.00120.154920.0006
Override
Cache load0.00190.2495300.0001
Sytem overhead
Fetch class attribute can translate value0.00130.168540.0003
Fetch class attribute name0.00120.157970.0002
XML
Image XML parsing0.00140.187940.0004
class_abstraction
Instantiating content class attribute0.00000.001980.0000
General
dbfile0.00690.8991360.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 27
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs