PHP:
<div align="center">
Enter your long URL here:<br/>
<form action="adf.php" method="post">
<input type="text" value="http://" name="turl" id="turl">
<input type="submit" name="submit" value="MakeShort!">
</form>
</div>
<?php
if(isset($_POST['submit']))
{
function makeShort()
{
$turl=urlencode($_POST["turl"]);
$uid="ADF.LY UID";
$key="ADF.LY KEY";
$advert_type="int";
$url="http://api.adf.ly/api.php?key=".$key."&uid=".$uid."&advert_type=".$advert_type."&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'>Thank you for using this service</div><br/>";
$surl = makeShort();
echo"<div align='center'>Your short URL is:<br/>";
echo"<strong><a href='$surl'>$surl</a></strong>";
?>
when i try to use this on hosting, this error message comes up. how can i solve this issue?
"Parse error: syntax error, unexpected $end in /home/a657xxxx/public_html/index.php on line 35"