JezK
Edit File: securedajax.php
<?php if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { $ajaxResult=[]; include_once("app/adminObj.php"); $requestFrom=explode("/",$_SERVER['HTTP_REFERER']); $sk=WEBSITENAME; // $compareVariable=''; // if($requestFrom['2']== 'localhost') //local // { // $compareVariable=$requestFrom['4']."/"; // } // else if($requestFrom['2']== 'bu1dev.kriy.com') // { // $compareVariable=$requestFrom['3']."/"; // } // $compareVariable=$requestFrom['3']."/"; // echo "2344"; // if($compareVariable==$sk) // { // echo "234"; if(isset($_REQUEST['process']) && $_REQUEST['process']=='checkExistsOrNot') { $resultJson=json_decode($_POST['data'],true); if($resultJson['type']==1) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkCompanyExists($replaceString,1); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==2) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkEmailExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==3) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkPhoneExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==9) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkPhoneExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==4) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkCompanyExists($replaceString,2); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==5) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkEmailExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==6) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkEmailExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } else if($resultJson['type']==7) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkAdminEmailExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; }else if($resultJson['type']==8) { $replaceString=str_replace("***"," ",$resultJson['requestedValue']); $rs=$customerObj->checkAdminPhoneExistsOrNot($replaceString); $ajaxResult['state']='success'; $ajaxResult['result']=$rs; } } echo json_encode($ajaxResult); } // } // else // { // echo "Not AJAX"; // } ?>