Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/256.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Facebook开放图形动态地图布局_Php_Objective C_Facebook_Facebook Graph Api_Facebook Opengraph - Fatal编程技术网

Php Facebook开放图形动态地图布局

Php Facebook开放图形动态地图布局,php,objective-c,facebook,facebook-graph-api,facebook-opengraph,Php,Objective C,Facebook,Facebook Graph Api,Facebook Opengraph,我可以成功地将路线发布到facebook开放图,路线将显示在他们的地图中。但是,这仅在我在php中硬编码坐标时有效,如下所示: <meta property="vaarapp:route:longitude" content="4.948997"> <meta property="vaarapp:route:altitude" content="0.01"> <meta property="vaarapp:route:latitude" content="52.24

我可以成功地将路线发布到facebook开放图,路线将显示在他们的地图中。但是,这仅在我在php中硬编码坐标时有效,如下所示:

<meta property="vaarapp:route:longitude" content="4.948997">
<meta property="vaarapp:route:altitude" content="0.01">
<meta property="vaarapp:route:latitude" content="52.24525">
<meta property="vaarapp:route:longitude" content="4.948997">
<meta property="vaarapp:route:altitude" content="0.01">
function curPageURL() {
 $pageURL = 'http://';
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
?>

<html>
  <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# vaarapp: http://ogp.me/ns/fb/vaarapp#">
    <meta property="fb:app_id" content="<?php echo strip_tags($_REQUEST['fb:app_id']);?>">
    <meta property="og:url" content="<?php echo strip_tags(curPageURL());?>">
    <meta property="og:type" content="<?php echo strip_tags($_REQUEST['og:type']);?>">
    <meta property="og:title" content="<?php echo strip_tags($_REQUEST['og:title']);?>">
    <meta property="og:image" content="<?php echo strip_tags($_REQUEST['og:image']);?>">
    <meta property="og:description" content="<?php echo strip_tags($_REQUEST['app:description']);?>">

    <meta property="app:location:latitude"      content="<?php echo strip_tags($_REQUEST['app:location:latitude']);?>">
    <meta property="app:location:longitude"     content="<?php echo strip_tags($_REQUEST['app:location:longitude']);?>">

    <meta property="app:distance" content="<?php echo strip_tags($_REQUEST['app:distance']);?>">
    <meta property="app:time" content="<?php echo strip_tags($_REQUEST['app:time']);?>">








    <!-- <meta property="app:route:latitude" content="52.24525">
    <meta property="app:route:longitude" content="4.948997">
    <meta property="app:route:altitude" content="0.01">
    <meta property="app:route:latitude" content="52.24525">
    <meta property="app:route:longitude" content="4.948997">
    <meta property="app:route:altitude" content="0.01">
    <meta property="app:route:latitude" content="52.239785">
    <meta property="app:route:longitude" content="4.920502">
    <meta property="app:route:altitude" content="0.01">
    <meta property="app:route:latitude" content="52.233162">
    <meta property="app:route:longitude" content="4.978008">
    <meta property="app:route:altitude" content="0.01"> -->

但我想从iphone中动态添加这些坐标。我已经有了一个坐标数组,但不知道如何将其作为变量发送到php脚本。有人能帮我吗

这就是我将信息从iPhone发送到PHP脚本的方式,PHP脚本最终将在我的facebook应用程序中发布该操作:

NSMutableString *format = [self createFacebookFormat];



NSString *attributes =
@"fb:app_id=421596134540169&og:type=%@&"
@"og:title=%@&og:description=%%22Lorem ipsum test description%%22&"
@"og:image=%@&"
@"vaarapp:distance=%d&"
@"vaarapp:time=%d&"
@"vaarapp:location:latitude=%f&"
@"vaarapp:location:longitude=%f&";
[format appendString:attributes];

// create an FBGraphObject object, but we can treat it as
// an FBRoute with typed properties, etc. See <FacebookSDK/FBGraphObject.h>
// for more details.
id<FBLocation> result = (id<FBLocation>)[FBGraphObject graphObject];

// Give it a URL that will echo back the name of the meal as its title,
// description, and body.
result.url = [NSString stringWithFormat:format, ogObject, title, catagory, 10, 4,     coordinate.latitude, coordinate.longitude];
NSMutableString*格式=[self-createFacebookFormat];
NSString*属性=
@“fb:app_id=421596134540169&og:type=%@&”
@“og:title=%@&og:description=%%22Lorem ipsum测试说明%%22&”
@“og:image=%@&”
@“vaarapp:距离=%d&”
@“瓦拉普:时间=%d&”
@“瓦拉普:位置:纬度=%f&”
@“瓦拉普:位置:经度=%f&”;
[格式追加字符串:属性];
//创建FBGraphObject对象,但我们可以将其视为
//具有类型化属性等的FBRoute。请参阅
//更多细节。
id结果=(id)[FBGraphObject graphObject];
//给它一个URL,它会回显食物的名称作为它的标题,
//描述,和正文。
result.url=[NSString stringWithFormat:format,ogObject,title,catagory,10,4,坐标.纬度,坐标.经度];
php脚本如下所示:

<meta property="vaarapp:route:longitude" content="4.948997">
<meta property="vaarapp:route:altitude" content="0.01">
<meta property="vaarapp:route:latitude" content="52.24525">
<meta property="vaarapp:route:longitude" content="4.948997">
<meta property="vaarapp:route:altitude" content="0.01">
function curPageURL() {
 $pageURL = 'http://';
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
 }
 return $pageURL;
}
?>

<html>
  <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# vaarapp: http://ogp.me/ns/fb/vaarapp#">
    <meta property="fb:app_id" content="<?php echo strip_tags($_REQUEST['fb:app_id']);?>">
    <meta property="og:url" content="<?php echo strip_tags(curPageURL());?>">
    <meta property="og:type" content="<?php echo strip_tags($_REQUEST['og:type']);?>">
    <meta property="og:title" content="<?php echo strip_tags($_REQUEST['og:title']);?>">
    <meta property="og:image" content="<?php echo strip_tags($_REQUEST['og:image']);?>">
    <meta property="og:description" content="<?php echo strip_tags($_REQUEST['app:description']);?>">

    <meta property="app:location:latitude"      content="<?php echo strip_tags($_REQUEST['app:location:latitude']);?>">
    <meta property="app:location:longitude"     content="<?php echo strip_tags($_REQUEST['app:location:longitude']);?>">

    <meta property="app:distance" content="<?php echo strip_tags($_REQUEST['app:distance']);?>">
    <meta property="app:time" content="<?php echo strip_tags($_REQUEST['app:time']);?>">








    <!-- <meta property="app:route:latitude" content="52.24525">
    <meta property="app:route:longitude" content="4.948997">
    <meta property="app:route:altitude" content="0.01">
    <meta property="app:route:latitude" content="52.24525">
    <meta property="app:route:longitude" content="4.948997">
    <meta property="app:route:altitude" content="0.01">
    <meta property="app:route:latitude" content="52.239785">
    <meta property="app:route:longitude" content="4.920502">
    <meta property="app:route:altitude" content="0.01">
    <meta property="app:route:latitude" content="52.233162">
    <meta property="app:route:longitude" content="4.978008">
    <meta property="app:route:altitude" content="0.01"> -->
函数curPageURL(){
$pageURL='http://';
如果($\服务器[“服务器\端口”!=“80”){
$pageURL.=$\u服务器[“服务器名称”]。:“$\u服务器[“服务器端口”]。$\u服务器[“请求URI”];
}否则{
$pageURL.=$\u服务器[“服务器名称”]。$\u服务器[“请求URI”];
}
返回$pageURL;
}
?>

通过在php中添加坐标进行修复。不需要大的url。

我实际上成功地用数组值回显了行,但是我的GET url变大了。如此之大以至于大的路由会产生错误。我可以用邮局代替GET吗。如果有的话,有人能给我举个例子吗?