clipbucket/upload/ajax/commonAjax.php

37 lines
799 B
PHP
Raw Normal View History

2016-04-05 15:02:28 +05:00
<?php
2016-04-08 11:08:10 +05:00
/**
* File: Common Ajax
* Description: ClipBucket default ajax file has gone too big. Time to make things a little cleaner
* @since: 4th April, 2016, ClipBucket 2.8.1
* @author: Saqib Razzaq
* @modified: 8th April, 2016
*/
2016-04-05 15:02:28 +05:00
require '../includes/config.inc.php';
if (isset($_POST['mode'])) {
$mode = $_POST['mode'];
global $db;
switch ($mode) {
case 'emailExists':
$email = $_POST['email'];
$check = $db->select(tbl('users'),"email"," email='$email'");
if (!$check) {
echo "NO";
}
break;
case 'userExists':
$username = $_POST['username'];
$check = $db->select(tbl('users'),"username"," username='$username'");
if (!$check) {
echo "NO";
}
break;
default:
# code...
break;
}
}
?>