mirror of
https://github.com/cydrobolt/polr.git
synced 2024-11-10 04:02:28 +01:00
28 lines
662 B
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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|