0

如何向每个动态创建的页面(www.page.com/index.php?page=article&id=1)添加不同的元(opengrapg)标签,我试图把它放在文章页面中:

<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:og="http://ogp.me/ns#"
      xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>

 <meta property="og:title" content="<?php echo $title?>" />
 <meta property="og:type" content="article" />
 <meta property="og:url" content="http://www.page.com/index.php?page=article&id=<?php echo $id ?>" />
 <meta property="og:image" content="http://www.page.com/image.png" />
 <meta property="og:site_name" content="eeeeee" />
 <meta property="og:description" content="<?php echo $desc; ?>"/>
 <meta property="fb:admins" content="blabla" /> 

  </head>

但 FB Linter 看不到它们 - “缺少必需的属性”

我简单地包含带有开关功能的 article.php 页面

$conlibrary="play/pages/"   ;                   
    IF(!isset($_GET['page'])){ 
        $page = 'deafault'; 
    } ELSE { 
         $page = $_GET['page']; 
         $findme = '&';
          $pos = strpos($page, $findme); 
    IF ($pos ===true) { 
        $data = explode("&", $data); 
        $dest =$conlibrary."/".$data[0].".php"; 
        IF (file_exists($dest)) {
            $page = $_GET['page']; 
        } ELSE {
            $page = '404'; 
        } 
    } ELSE { 
        $dest =$conlibrary."/".$page.".php"; 
        IF (file_exists($dest)) {
            $page = $_GET['page'];
        } ELSE {
            $page = '404'; 
        } 
    } 
} 

include($conlibrary . $page .".php"); 

4

1 回答 1

0

Your missing the ? in your URL...

www.page.com/?page=article&id=1

not

www.page.com/page=article&id=1

于 2011-05-31T08:11:52.337 回答