Facebook上的iframe应用程序$ _GET [英] $_GET on facebook iframe app

查看:121
本文介绍了Facebook上的iframe应用程序$ _GET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图在我的iframe facecbook应用程序上使用GET方法传递一些数据,但在页面内没有数据,我的代码是

I'm trying to pass some data using GET method on my iframe facecbook app , but inside the page there is no data , my code is

<?php 

echo '<pre>';
print_r($_GET);
die()
?> 

并尝试传递apps.facebook.com/APPNAME/?p=23
或apps.facebook.com/APPNAME/index.php?p=23

and trying to pass like apps.facebook.com/APPNAME/?p=23 or apps.facebook.com/APPNAME/index.php?p=23

推荐答案

忘记其他海报所说的内容。普通画布应用程序不接受app_data参数,只有标签应用程序才能接受。但您可以使用除画布URL之外的自定义URL。让我告诉你它是如何工作的。

Forget what the other poster said. Normal canvas apps do not accept the app_data parameter, only tab apps do. But you can use custom URLs beyond just the canvas URL. Let me show you how this works.

我的应用:

我有一个名为PulseTrack的应用程序。主应用程序URL为:

I have an app called PulseTrack. The main App URL is:

http:// apps .facebook.com / pulsetrack /

哪个指向此画布网址:

http://mydomain.com/pulsetrack/

但是我也可以使用这个网址:

But I can also use this url:

http ://apps.facebook.com/pulsetrack/watch/EP011583610051

哪个指向:

http://mydomain.com/pulsetrack/watch/EP011583610051

您的应用

如果您可以像这样设置画布网址,请使用直接PHP:

Using straight up PHP if you can setup your canvas URL like this:

http://yourdomain.com/index.php

然后你可以将目录参数传递给th您的网址结束如下:

Then you can pass directory parameters to the end of your URL like so:

http://apps.facebook.com/your-app/your/awesome/params

您将会这样:

http:// yourdomain .com / index.php?/ your / awesome / params

这样的东西应该能够解析查询字符串中的那些参数

Something like this should be able to parse those "parameters" from the query string

$query = $_SERVER['QUERY_STRING'];
$params = explode("/", $query);

祝你好运,这花了我很长时间才算清楚。

Best of luck, this took me a long to figure out.

这篇关于Facebook上的iframe应用程序$ _GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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