I am working on a small app that uses the shareaholic API in PHP. I created a small function that will cunstruct the correct url. When the string is returned it returns it with a line break after the v. Output below:
So the browser only gets the url up to the /?
here is the php
function createShareToLink($serv, $name){
$sharebase = 'http://www.shareaholic.com/api/share/?v=1';
$apitype = "&apitype=1";
$apikey = "&apikey=redacted";
$twitter = false;
$title = trim("redacted");
$title = urlencode($title);
$url = "http://redacted.com/contest-page/";
$msg = urlencode("I voted for $name's photo to win");
switch($serv){
case 1: //facebook
$service = "&service=5";
break;
case 2: //twitter
$twitter = true;
$service = "&service=7";
break;
case 3: //Google
$service = "&service=304";
break;
default:
$service = "&service=5";
break;
}
if(!$twitter){
$shareurl = $sharebase . $apitype . $apikey . $service . '&link=' . $url . '&title=' . $title . '&notes=' . $msg;
} else {
$shareurl = $sharebase . $apitype . $apikey . $service . '&link=' . $url . '&title=' . $title . '&template=redacted.com%20100lbs%20BBQ%20Giveaway%20${short_link}%20via%20@redacted%20%23Contest%20%23Giveaway';
}
return $shareurl;
}
I have never run into this, any ideas? Output displayed in WordPress Into a HTML form, I can see the entire link, but it breaks right after the ? which is that is passed to the browser on click. Also shareaholic api returns that all info is null.