A więc napisałem skrypt api adf.ly króry działą na tej stronie shortbb.tk.
Znalazłem stronkę która ma takie samo api lecz zwraca mi błąd
Moj kod
index.php
<?php
include 'header.php';
?>
<div class="contentbox">
<h1>Skracacz linków</h1>
<div id="short">
<div align="center">
Wpisz długi link<br/>
<form action="short.php" method="post" id="subscribeform">
<input type="text" value="http://facebook.pl/" onfocus="if(this.value=='http://facebook.pl/'){this.value=''};" onblur="if(this.value==''){this.value='http://facebook.pl/'};" name="turl" id="turl">
<input type="image" src="./images/short.png" name="submit" value="Skróc">
</form>
</div>
</div>
<?php
include 'footer.php';
?>
short.php
<?php
if(isset($_POST['submit'])) {
function makeShort()
{
$uid = "540";
$key = "458b9dac8cca5216348c2782180ad1f6";
$advert_type = "int";
$domain = "zpag.es";
$url = "http://zpag.es/api.php?key=".$key."&uid=".$uid."&advert_type=".$advert_type."&domain=".$domain."&url=".$turl."";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
curl_setopt($ch, CURLOPT_URL, $url);
$content = curl_exec($ch);
curl_close($ch);
return $content;
}
?>
<?php
echo"<div align='center'></div><br/>"; $surl = makeShort();
echo"<div align='center'>Twój skrócony link<br/>"; echo"<strong><a href='$surl'>$surl</a></strong>"; }
?>
Nie mam pojęcia czy to wina curl czy może czegoś innego mimo że api z adf.ly jest taki same
Możecie zarejestrować się tu link z moim ref
zPag.es