Drupal表单提交给第三方网站 [英] Drupal form submission to a 3rd party website

查看:169
本文介绍了Drupal表单提交给第三方网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Drupal建立一个表单,需要提交给第三方网站。在表单API中,您似乎不太可能,因为您注册表单提交处理程序来执行所有处理。我需要使用表单方法来POST,并且它需要提交到本网站,因为它是第三方托管的订购系统。有人遇到类似的情况吗?任何建议?

解决方案

使用表单数组中的 #action 属性:

  $ form ['#action'] ='http://example.com'; 


I'm building a form in Drupal that needs to submit to a 3rd party website. Within the form API it seems like this is not really possible as you register form submission handlers to do all of the processing. I need to have the form method to to POST and it needs to be submitted to this website as it is a 3rd party hosted ordering system. Has anyone run into a similar situation? Any suggestions?

解决方案

Use the #action attribute on the form array:

$form['#action'] = 'http://example.com';

这篇关于Drupal表单提交给第三方网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆