After making some changes to the file, I have an error "Syntax error, unexpected 'm' (T_STRING) on line 91". I checked the code several times on my own and I can not solve the problem.
File create.php :
<title>Kevin Andrews / TXT</title>
<?php
$displayform = 'display';
if ($_GET['form'] == $displayform)
{
echo '<form method="get" action="">
<input type="hidden" name="form" value="display">
<input name="url" placeholder="Enter the long link (http://...)" size="50" <="" input=""><br>
<input type="password" name="password" placeholder="Password" size="17" maxlength="15"><br>
<input type="submit" value="Create"> or <input type="submit" href="" value="Refresh">
</form>
<hr>';
} else {
echo "";
}
$shortenedlink = mt_rand(10000, 99999);
$password = 'quieroentrar123';
$longlink = $_GET['url'];
if (!isset($longlink) || trim($longlink) == '') {
echo "The long link is empty.";
exit;
}
$notallowed = array("<",">");
$longlink = str_replace($notallowed,"", $longlink);
if ($_GET['password'] == $password)
{
echo "";
} else {
echo "The password is not valid.";
exit;
}
$shortenedlinkpath = "../$shortenedlink.asp";
if (file_exists($shortenedlinkpath)) {
echo "The assigned number already exists, please try again.";
exit;
} else {
echo "";
}
$shortenedfilecontent = '<title>Outgoing to #'.$shortenedlink.'</title>
<script type="text/javascript" language="javascript">
window.addEventListener("load", function() {
setTimeout(func1, 10000);
});
function func1() {
document.getElementById("div1").className = "show";
}
window.addEventListener("load", function() {
setTimeout(func2, 10000);
});
function func2() {
document.getElementById("div2").className = "hide";
}
</script>
<script type="text/javascript" language="javascript">
// Internet Explorer
window.onload = function()
{
document.onselectstart = function()
{
return false;
}
// Firefox
document.onmousedown = function()
{
return false;
}
}
</script>
<style type="text/css">
.hide{
display:none;
}
.show{
display:block;
}
</style><p>An anonymous user has used this service to create a shortened URL with a redirect to an external page. For your security, the page to which you will be redirected in 30 seconds is:<form action="" method="post"><input type="text" size="50" placeholder="'.$longlink.'" readonly onmousedown="return false;" /></form><img style="border:5px double black;" alt="It seems that the screenshot of the site can not be seen. Reload the page or re-create the shortened link." src="https://auth.kenygamer.com/api/image?width=340&height=200&screen=1024&url='.$longlink.'"><br><br>If this URL is not what you were looking for or it may not be according to your criteria, please leave this page immediately to avoid being redirected, otherwise ignore this warning and touch the button that will appear below this text 10 seconds after the page was loaded.<div id="div1" class="hide"><form action="'.$longlink.'" method=""><center><input type="submit" value="Redirect"></center></form></div><br><hr>The URL you are viewing has been shortened for free. Shorten yours at http://auth.kenygamer.com and provide security to your visitors by giving them the link (not selectable) and a screenshot of the site they are going to. If you think I'm doing well, consider donating.</p><meta http-equiv="refresh" content="30; url='.$longlink.'">';
$fp = fopen("../$shortenedlink.asp", "w");
fwrite($fp, $shortenedfilecontent) . ' ';
fclose($fp);
$line = date('Y-m-d H:i:s') . " - $longlink - #$shortenedlink - $_SERVER[REMOTE_ADDR] \n";
$fplog = fopen("../logs/d41d8cd98f00b204e9800998ecf8427e-create.txt", "a+");
fwrite($fplog, $line) . ' ';
fclose($fplog);
echo ("The shortened URL has been successfully created. The shortened number #$shortenedlink has been assigned to your long URL $longlink.");
?>
According to PHP, the error should be located on line 91 of this file, and it is one of the parts that I reviewed several times.