MODx 电子表格内部服务器错误

发布于 2024-10-11 09:18:39 字数 1276 浏览 5 评论 0原文

我在使用电子表格片段时遇到一些问题。每次提交表单时,我都会收到内部服务器错误 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

煮茶煮酒煮时光 2024-10-18 09:18:39

您的 eForm 调用会触发 eFormOnBeforeFormMerge 和 eFormOnBeforeMailSent 事件,并且对于这些事件分别调用函数 ref 和 form_user_ok (作为 eForm 事件处理程序)。我假设您需要调用这些函数来进行一些自定义处理(您没有指定)。如果不是,则省略 eFormOnBeforeFormMerge 和 eFormOnBeforeMailSent 参数并直接消除服务器错误。

如果这些事件需要自定义处理:请仔细跟踪这些调用,因为它们可能是问题的根源。这些函数实际上存在吗?它们是否包含在您的 eForm 调用之前? php 格式是否正确

请注意,通常情况下,您会收到带有一些描述性文本的 php 错误,而 eForm 事件处理程序最终总是会导致服务器错误 500。因此,请务必检查语法错误,并且可能失败包括以及任何其他导致 php 错误的原因。

预先提供 2 个函数,以便可以将它们作为 eForm 事件处理程序进行调用。您可以定义一个包含两者的代码片段,如下所示:

// snippet name: myEformFunctions

function ref()
{
    // do your thing here
    return; // important, never return false can trigger server error
}

function form_user_ok()
{
    // do your thing here
    return; // important, never return false can trigger server error
}

然后在您的 eForm 调用之前添加:

[!myEformFunctions!]

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:

// snippet name: myEformFunctions

function ref()
{
    // do your thing here
    return; // important, never return false can trigger server error
}

function form_user_ok()
{
    // do your thing here
    return; // important, never return false can trigger server error
}

then before your eForm call add:

[!myEformFunctions!]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文