Parse error: syntax error, unexpected '{' in /path/to/the/website/file.php on line 18 : <p>The issue says unexpected {..... I dont understand why this is hapenning i remove it and i still ahve issues. Please reply with th right code.</p>

<p>Kevin Andrews / Auth</p>

<pre><code>&lt;?php

$shortenedlink = mt_rand(10000,99999);
$longlink = $_POST['longlink'];
if(!isset($longlink) || trim($longlink) == '')
{
   echo "The link field is empty. Redirecting you in 3 seconds.";
   header ( "refresh:3;url=http://auth.kenygamer.com" );
   exit;

$shortenedlinkpath = "$shortenedlink.asp";
if (file_exists($shortenedlinkpath))
{
    echo "An error occurred creating the shortened link, because the assigned number already exists. However, you can retry. Copy the link and paste it again on the main page:&lt;br&gt;&lt;br&gt;$longlink&lt;br&gt;&lt;br&gt;Redirecting you in 15 seconds.";
    header( "refresh:15;url=http://auth.kenygamer.com" );
    exit;

}
else
{
    echo "";
}

$shortenedfilecontent = '&lt;title&gt;Outgoing link&lt;/title&gt;&lt;meta http-equiv="refresh" content="5; url=$longlink"&gt;';
$fp = fopen("$shortenedlink.asp", "w"); 
fwrite($fp, $shortenedfilecontent).'&amp;nbsp;'; 
fclose($fp);

echo ("The shortened URL has been successfully created. The shortened number #$shortenedlink has been assigned to your long URL $longlink. Therefore, it is accessible at https://auth.kenygamer.com/$shortenedlink at any time. Remember that you can always create new shortened URLs.&lt;br&gt;&lt;br&gt;Long link: $longlink&lt;br&gt;Shortened link: $shortenedlink&lt;br&gt;&lt;br&gt;Redirecting you in 20 seconds.");
header( "refresh:20;url=https://auth.kenygamer.com/$shortenedlink" );
?&gt;
</code></pre>
