Apologies for the delay in getting back to you.
Open ./config.php and change the following code from:
- Code: Select all
$shorturl = false;
to
- Code: Select all
$shorturl = true;
However, this will form a link similar to the one you requested, but with the random number. The random number is implemented to allow more than one user to have the same title. DLP is not designed to be used without the random number. Nevertheless, you can remove the random number by the following steps:
1) In ./index.php remove:
- Code: Select all
$fancyurl = rand(0, 999) . $title;
2) Replace
- Code: Select all
$rand2 = ("$fancyurl");
with
- Code: Select all
$rand2 = $title;
3) Now,
move the following the code:
- Code: Select all
$rand2 = $title;
$filename = "./files/" . $rand2 . ".dlp";
under
- Code: Select all
$todaydate = getdate();
4) Replace
- Code: Select all
echo "<div class=\"error\"><img src=\"./img/error.png\">Please fill in all the fields below:</div>";
} else {
with
- Code: Select all
echo "<div class=\"error\"><img src=\"./img/error.png\">Please fill in all the fields below:</div>";
} else if (file_exists($filename)) {
echo "<div class=\"error\"><img src=\"./img/error.png\">Sorry, but the short url with that title has already been taken. Please choose another title and try again.</div>";
}else{
5) Remove
- Code: Select all
if (file_exists($filename)) {
die("An unusual error occured. Please navigate BACK using your browser and re-submit your links again.");
} else {
6) Replace
- Code: Select all
<div class="success"><img src="./img/success.png">Your new URL is <?
echo $scripturl . $short . $rand2;
?></div>
<?
}
}
}
with
- Code: Select all
<div class="success"><img src="./img/success.png">Your new URL is <?
echo $scripturl . $short . $rand2;
?></div>
<?
}
}