Facebook PHP表单返回空$

编程入门 行业动态 更新时间:2024-10-28 10:32:38
本文介绍了Facebook PHP表单返回空$ _POST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我最近一直在开发一些Facebook应用程序,并且我总是遇到同样的问题:我找不到一种在iFrame Facebook应用程序上使用POST方法发送表单的方法。返回的 $ _ POST 始终为空。

我发现一个补丁是使用表单发送我的数据GET方法,并将其发送到画布页脚本URL,如下所示:< form action =<?php echo CANVAS_PAGE;?> script.phpmethod =GET> ,然后通过 $ _ REQUEST 获取我的数据。 我尝试使用POST / GET方法与 CANVAS_PAGE / script.php / CANVAS_URL / script.php / script.php 动作,这只是实际工作的东西。至少对我来说

现在,我遇到的问题是我需要上传一个文件,然后我必须使用POST方法,然后回到最初的问题 - >我找不到一种使用POST方法发送表单的方法。任何人都有答案?

解决方案

发现答案。

只要你通过了Facebook的post方法, $ _REQUEST [signed_request]作为您表单中的signed_request的隐藏字段。

I've been developing some Facebook apps lately and I always had the same problem: I can't find a way to send a form with a POST method on iFrame Facebook apps. The returned $_POST is always empty.

One patch I found is to send my data using a form using a GET method and to send it to the canvas page script URL, just like this: <form action="<?php echo CANVAS_PAGE; ?>script.php" method="GET" > and then to get my data through $_REQUEST. I tried any combination of POST /GET method with CANVAS_PAGE/script.php / CANVAS_URL/script.php / script.php action and this is only thing that actually works. AT least for me.

Now, the problem I have is that I need to upload a file and then I must use the POST method and then back to the initial problem -> I can't find a way to send a form with a POST method. The returned $_POST is always empty!!

Anybody has an answer to that?

解决方案

Answer found.

The post method in Facebook works fine as long as you pass the $_REQUEST["signed_request"] as a hidden field called "signed_request" in your form.

更多推荐

Facebook PHP表单返回空$

本文发布于:2023-10-10 11:59:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1478609.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表单   Facebook   PHP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!