1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-09-19 23:21:47 +02:00
polr/ajaxhandler.php

28 lines
662 B
PHP
Raw Normal View History

<?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;
}
}
}