1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-13 21:52:29 +01:00
polr/ajaxhandler.php

28 lines
662 B
PHP

<?php
require_once('req.php');
class ajaxhandler {
public function __construct() {
global $mysqli;
}
function linkcheck($link) {
global $mysqli;
if(!ctype_alnum($link) || strlen($link)>20) {
return 3;
}
$iscustom = "yes";
$query = "SELECT rid FROM redirinfo WHERE baseval='{$link}'"; //check if baseval used already
$result = $mysqli->query($query);
$row = mysqli_fetch_assoc($result);
$custom_existing = $row['rid'];
if($custom_existing) {
return false;
}
else {
return true;
}
}
}