okay so im trying to enter a dynamic meta tag for the facebook api and some wierd things are happnening.
here is how im getting the value
$id = $_GET['id'];
$id = intval($id);
and this is where i input it.
<meta property="og:url" content="http://blaze-craft.com/matt/gag.php?id=<?php echo $id ? >" />
<meta property="og:image" content="http://blaze-craft.com/matt/get.php?id=<?php echo $id ?>" />
But it is always outputing the value as 0 even when its not 0. Also when i echo it out anywhere else on the page it works?
any help would be great thanks! 😀
Okay iv just seen in the source code it is being set
<html>
<head>
<title>YourGag - Gag</title>
<meta property="og:title" content="MyGag - Gag" />
<meta property="og:type" content="activity" />
<meta property="og:url" content="http://blaze-craft.com/matt/gag.php?id=2" />
<meta property="og:image" content="http://blaze-craft.com/matt/get.php?id=2" />
<meta property="og:site_name" content="YourGag" />
<meta property="fb:admins" content="1254694731" />
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
but when im use the facebook debugger its saying that there is a 0 there instead of a 2!
seriosly wierd!
Have you tried debugging the value of
$_GET['id']before attempting to cast as anint?Per the documention (
intval):So
$_GET['id']is either an empty array or cannot be returned as an integer value.