I try to implement a Google +1 button in my website, but for some reason, I get the red exclamation mark as error…
And the weird part is the following. This snippet works perfect:
<span class="st_plusone" st_url="http://www.google.com/"></span>
But when I fill in my own URL, it goes wrong…
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
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;
}
$url= curPageURL();
$st_spans .= "<span class=\"st_plusone\" st_url=$url></span>";
What am I doing wrong to get this +1 thing working?
Ok, I figured it out myself. Apparently, dev sites aren’t allowed in the URL :
So,
dev.mysite.comisn’t allowed, butwww.mysite.comis!