分享 link 个页面
Sharing link of a page
我正在分享 link 来自用户个人资料的事件,事件页面是动态的,当用户点击分享到 Facebook 时,我获取事件 ID 并将其存储到 Session 变量中,然后我我在事件页面中使用此会话变量来描述:og 标签。但是我的:og 标签没有显示数据。
这是我的代码:
function post(id) {
document.cookie = "eventID = "+id;
<?php $_SESSION['EVENT_ID'] = $_COOKIE['eventID']; ?>;
FB.ui({
method: 'share',
href: "mywebsiteURL/events.php"
}
}
//Here is the head of my events.php
$col = 'events.*,status.name as statusName,mosque_reg.name as mosque';
$table = "events,status,mosque_reg";
$where = "events.id = '".$obj->verifyint($_SESSION['EVENT_ID'])."' AND events.status_id = status.id
AND events.inserted_by = mosque_reg.inserted_by";
$ticket = $obj->read_specific_event($col,$table,$where);
if($ticket->num_rows>0)
{
$issue = $ticket->fetch_assoc();
$pic ="https://www.theglobalmuslim.com/mosque/portal/images/events/".$issue['photo'];
$contactName = $issue['contactPerson'];
$contact = $issue['contactNumber'];
$description = $issue['description'];
$topic = $issue['topic'];
}
?>
<meta property="fb:app_id" content="258374655358948" />
<meta property="og:site_name" content="The Global Muslim"/>
<link property="og:url" content="https://www.theglobalmuslim.com/events.php?id=<?php echo
$_SESSION['EVENT_ID']; ?>"/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Event Name:<?php echo $topic; ?>" />
<meta property="og:description" content="New event is held at Mosque <?php echo
$issue['mosque']."\n."." Description: ".$description ?>" />
<meta property="og:image" content="<?php echo $pic; ?>" />
我通过打开内部页面的 URL 解决了这个问题,他们我使用 GET 方法在 :og 标签中显示事件信息。
我正在分享 link 来自用户个人资料的事件,事件页面是动态的,当用户点击分享到 Facebook 时,我获取事件 ID 并将其存储到 Session 变量中,然后我我在事件页面中使用此会话变量来描述:og 标签。但是我的:og 标签没有显示数据。 这是我的代码:
function post(id) {
document.cookie = "eventID = "+id;
<?php $_SESSION['EVENT_ID'] = $_COOKIE['eventID']; ?>;
FB.ui({
method: 'share',
href: "mywebsiteURL/events.php"
}
}
//Here is the head of my events.php
$col = 'events.*,status.name as statusName,mosque_reg.name as mosque';
$table = "events,status,mosque_reg";
$where = "events.id = '".$obj->verifyint($_SESSION['EVENT_ID'])."' AND events.status_id = status.id
AND events.inserted_by = mosque_reg.inserted_by";
$ticket = $obj->read_specific_event($col,$table,$where);
if($ticket->num_rows>0)
{
$issue = $ticket->fetch_assoc();
$pic ="https://www.theglobalmuslim.com/mosque/portal/images/events/".$issue['photo'];
$contactName = $issue['contactPerson'];
$contact = $issue['contactNumber'];
$description = $issue['description'];
$topic = $issue['topic'];
}
?>
<meta property="fb:app_id" content="258374655358948" />
<meta property="og:site_name" content="The Global Muslim"/>
<link property="og:url" content="https://www.theglobalmuslim.com/events.php?id=<?php echo
$_SESSION['EVENT_ID']; ?>"/>
<meta property="og:type" content="website" />
<meta property="og:title" content="Event Name:<?php echo $topic; ?>" />
<meta property="og:description" content="New event is held at Mosque <?php echo
$issue['mosque']."\n."." Description: ".$description ?>" />
<meta property="og:image" content="<?php echo $pic; ?>" />
我通过打开内部页面的 URL 解决了这个问题,他们我使用 GET 方法在 :og 标签中显示事件信息。