";
echo "Back";
die();
}
if($hpi !== $hp) {
echo "We have detected that you may be using automated methods to shorten links.
We offer a free API, please do not use our shorten page as an API.
If you are getting this message, but you are not a bot, please email support@polr.cf
Thanks.";
die();
}
$userinfo = $polrauth->islogged();
if(!is_array($userinfo)) {
$il = false;
}
else {
$il = true;
}
$urlr = $mysqli->real_escape_string($urlr);
//Other URL Shorteners List Array
$isshort = array('polr.cf','bit.ly','is.gd','tiny.cc','adf.ly','ur1.ca','goo.gl','ow.ly','j.mp','t.co');
foreach ($isshort as $url_shorteners) {
if(strstr($urlr, $protocol.$url_shorteners)) {
echo "You entered an already shortened URL.
";
echo "Back";
die();
}
}
$query1 = "SELECT rid FROM redirinfo WHERE rurl='{$urlr}' AND iscustom='no'";
$result = $mysqli->query($query1);
$row = mysqli_fetch_assoc($result);
$existing = $row['rid'];
$decodescript = "";
$ip = $mysqli->real_escape_string($ip);
$customurl = $mysqli->real_escape_string($_POST['custom']);
if($customurl == "") {
$iscustom = "no";
}
//check custom url
$not_allowed_custom = array('.');
if($customurl!="") {
if(!ctype_alnum($customurl)) {
echo "Symbols or spaces are not allowed in a customized URL - alphanumeric only. Try again";
die();
}
if(strlen($customurl)>20) {
echo "The maximum length for a custom url is 20 letters. Try again";
die();
}
}
if(!$existing || $customurl!="") {
$query1 = "SELECT MAX(rid) AS rid FROM redirinfo;";
$result = $mysqli->query($query1);
$row = mysqli_fetch_assoc($result);
$ridr = $row['rid'];
$baseval = base_convert($ridr+1,10,36);
if($customurl!="") {
$baseval = $customurl;
$iscustom = "yes";
$query = "SELECT rid FROM redirinfo WHERE baseval='{$customurl}'"; //check if baseval used already
$result = $mysqli->query($query);
$row = mysqli_fetch_assoc($result);
$custom_existing = $row['rid'];
if($custom_existing) {
echo "The custom shorturl ending you specified is already in use. Try again";
die();
}
}
$query2 = "INSERT INTO redirinfo (baseval,rurl,ip,user,iscustom,country) VALUES ('{$baseval}','{$urlr}','{$ip}','{$userinfo['username']}','{$iscustom}','{$country_code}');";
$result2r = $mysqli->query($query2) or showerror();
$basewsa = base64_encode($wsa);
$basebv =base64_encode($baseval);
echo "";
echo $decodescript;
echo "