MODx 电子表格内部服务器错误
我在使用电子表格片段时遇到一些问题。每次提交表单时,我都会收到内部服务器错误 500。有趣的是,报告电子邮件发送得很好,只是在表单发送后无法进入“谢谢”页面。这是错误日志:
[Tue Jan 11 10:23:07 2011] [error] [client 80.175.159.225] malformed header from script. Bad header=/home/sites/annuitiesadvice.co: index.php, referer: http://www.annuitiesadvice.co.uk/
这是我的表单块:(
<form method="post" action="[~[*id*]~]" name="contactform" onSubmit="javascript:populateHiddenFields(this);" id="rc_form">
我还尝试将表单操作设置为包含表单块的静态页面,例如 about-us.html)。
这是调用片段:
[!eForm?
&formid=`rc_form`
&to=`[email protected], [email protected], [email protected]`
&subject=`Quick Annuity Quote Submitted`
&tpl=`rc_form`
&report=`rc_form_report`
&gotoid=`55`
&eFormOnBeforeFormMerge=`ref`
&eFormOnBeforeMailSent=`form_user_ok`
!]
MODx 1.02 Apache2
知道什么可能导致这种情况吗?
I'm having a few problems with the eForm snippet. Every time a form is submitted I'm getting an Internal Server Error 500. Funny thing is, the report email is sent fine, just can't get to a "thank you" page after the form is sent. Here is the error log:
[Tue Jan 11 10:23:07 2011] [error] [client 80.175.159.225] malformed header from script. Bad header=/home/sites/annuitiesadvice.co: index.php, referer: http://www.annuitiesadvice.co.uk/
Here's my form chunk:
<form method="post" action="[~[*id*]~]" name="contactform" onSubmit="javascript:populateHiddenFields(this);" id="rc_form">
(I've also tried just setting the form action to a static page where the form chunk is included, such as about-us.html).
Here's the snippet call:
[!eForm?
&formid=`rc_form`
&to=`[email protected], [email protected], [email protected]`
&subject=`Quick Annuity Quote Submitted`
&tpl=`rc_form`
&report=`rc_form_report`
&gotoid=`55`
&eFormOnBeforeFormMerge=`ref`
&eFormOnBeforeMailSent=`form_user_ok`
!]
MODx 1.02
Apache2
Any idea what could cause this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 eForm 调用会触发 eFormOnBeforeFormMerge 和 eFormOnBeforeMailSent 事件,并且对于这些事件分别调用函数 ref 和 form_user_ok (作为 eForm 事件处理程序)。我假设您需要调用这些函数来进行一些自定义处理(您没有指定)。如果不是,则省略 eFormOnBeforeFormMerge 和 eFormOnBeforeMailSent 参数并直接消除服务器错误。
如果这些事件需要自定义处理:请仔细跟踪这些调用,因为它们可能是问题的根源。这些函数实际上存在吗?它们是否包含在您的 eForm 调用之前? php 格式是否正确?
请注意,通常情况下,您会收到带有一些描述性文本的 php 错误,而 eForm 事件处理程序最终总是会导致服务器错误 500。因此,请务必检查语法错误,并且可能失败包括以及任何其他导致 php 错误的原因。
预先提供 2 个函数,以便可以将它们作为 eForm 事件处理程序进行调用。您可以定义一个包含两者的代码片段,如下所示:
然后在您的 eForm 调用之前添加:
Your eForm call fires the events eFormOnBeforeFormMerge and eFormOnBeforeMailSent and for those events calls the functions ref and form_user_ok respectively (as sort of eForm event handlers). I assume you need to call these functioner for some custom processing (you did not specify). If not just omit the eFormOnBeforeFormMerge and eFormOnBeforeMailSent parameters and eliminate the server error directly.
If custom processing is required for these events: Trace these calls back carefully because they are likely the root of your issue. Do these functions actually exist and are they included before your eForm call? Is the php well formed?
Note that usually where normally you'd get a php error with some descriptive text, an eForm event handler always ends up causing server error 500. So make sure to check for syntax errors and possibly failed includes and any other causes for php errors.
To provide the 2 functions upfront so that they can be called as an eForm event handler. You could define a snippet having both of them like so:
then before your eForm call add: