| Server IP : 27.254.152.13 / Your IP : 216.73.217.38 Web Server : Apache/2 System : Linux ns1-252017.dragonhispeed.com 5.2.0 #1 SMP Fri Mar 29 22:50:14 MSK 2024 x86_64 User : coloflew ( 1072) PHP Version : 5.6.40 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/coloflew/.trash/files/fulltion.co.th/public_html/parcel/tester/lib/jquery/ |
Upload File : |
<?php
session_start();
########## Load the config file ##########
require_once(dirname(__FILE__) . '/../sys_config.php');
require_once(dirname(__FILE__) . '/../class/SC_Query.php');
require_once(dirname(__FILE__) . '/../class/SC_Mysql.php');
require_once(dirname(__FILE__) . '/../class/SC_Master.php');
// connect
$objConn = new SQL_DB();
$objMaster = new SC_Master();
$objQuery = new SC_Query();
//echo'<meta http-equiv="Content-Type" content="text/html; charset=utf-8">';
if ($_GET['check'] == "true") {
if ($_GET['type'] == "email") {
// check email, this checks for proper format of address, but also makes sure the domain is valid
// Reg exp for checking email format
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
// Validate the email format
if (@eregi($regexp, $_GET['value'])) {
//split email address if its valid so we can check domain
list($username, $tld) = @split("@", $_GET['value']);
// Validate the domain
if (getmxrr($tld, $mxrecords))
$o = 0;
} else {
$o = 1;
}
$where = "email = '".$_GET['value']."'";
$rows = $objQuery->getOne("user","*" ,$where);
if ($rows) {
$ox = 1;
} else {
$ox = 0;
}
//echo $rows;
//echo $where;
if($o == 1 || $ox == 1) {
echo "1";
} else {
echo "0";
}
}
if ($_GET['type'] == "username") {
//check to see if username already exists
$where = "user_name = '".$_GET['value']."'";
$rows = $objQuery->getOne("user","user_name" ,$where);
//echo "<pre>=>"; print_r($rows);
//exit;
if (!$rows) {
// no username match, ok to use
echo "0";
} else {
// match, not ok
echo "1";
}
}
}
?>