问题
I'm trying to use the PyroCMS Contact form in a facebook tab.
When displaying the page directly, everything is OK, the form page is displayed as wished without error message. https://facebook.noviris.com/tests/contact
When I integrate this page via a facebook page tab, it displays the form post errors on page load, not after using the submit button. https://www.facebook.com/gwadaweb?sk=app_197712883656289
回答1:
Facebook send signed_request parameter to your page tab every time you arrives to your FB page. Firebug shows this clearly.
So a good solution is stop processing your form when this parameter is present.
if ($_POST['signed_request'])
{
// do not process form
}
Firebug also show the referrer: https://s-static.ak.facebook.com/platform/page_proxy.php?v=4. Maybe you could use this too but do not seems very trusty that this location do not change.
来源:https://stackoverflow.com/questions/8990484/pyrocms-contact-form-in-facebook-tabs-displaying-errors-on-page-load