if(isset($_POST)) { $level = filter_input(INPUT_POST,'level',FILTER_SANITIZE_STRING); if(isset($_POST['clientLoginbtn'])){ $clientLogin_email = filter_input(INPUT_POST,'clientLogin_email',FILTER_SANITIZE_STRING); $clientLogin_password = filter_input(INPUT_POST,'clientLogin_password',FILTER_SANITIZE_STRING); global $wpdb; $getDataQuery = $wpdb->get_results("SELECT * FROM registered_users WHERE ru_email='".$clientLogin_email."' AND ru_password='".$clientLogin_password."' AND ru_web='academicwritingpro' LIMIT 1"); if(count($getDataQuery) > 0) { // output data of each row session_start(); foreach($getDataQuery as $key => $row) { $_SESSION["user_id"] = $row->id; $_SESSION["username"] = $row->ru_username; $_SESSION["web"] = 'academicwritingpro'; } echo 'You Have Successfully Login'; echo ""; exit(); //echo 'success'.$_SESSION["user_id"]."---".$_SESSION["username"]; }else{ echo "notfound"; } }if($level == "clientlogin"){ $clientLogin_email = filter_input(INPUT_POST,'clientLogin_email',FILTER_SANITIZE_STRING); $clientLogin_password = filter_input(INPUT_POST,'clientLogin_password',FILTER_SANITIZE_STRING); global $wpdb; $getDataQuery = $wpdb->get_results("SELECT * FROM registered_users WHERE ru_email='".$clientLogin_email."' AND ru_password='".$clientLogin_password."' AND ru_web='academicwritingpro' LIMIT 1"); if(count($getDataQuery) > 0) { // output data of each row session_start(); foreach($getDataQuery as $key => $row) { $_SESSION["user_id"] = $row->id; $_SESSION["username"] = $row->ru_username; $_SESSION["web"] = 'academicwritingpro'; } //echo 'You Have Successfully Login'; //echo ""; echo "success"; exit(); //echo 'success'.$_SESSION["user_id"]."---".$_SESSION["username"]; }else{ echo "notfound"; exit(); } } if(isset($_POST['clientSignupbtn'])){ $clientUsername = filter_input(INPUT_POST,'clientUsername',FILTER_SANITIZE_STRING); $clientEmail2 = filter_input(INPUT_POST,'clientEmail2',FILTER_SANITIZE_STRING); $clientPhone2 = filter_input(INPUT_POST,'clientPhone2',FILTER_SANITIZE_STRING); $clientPassword = filter_input(INPUT_POST,'clientPassword',FILTER_SANITIZE_STRING); $clientPassword2 = filter_input(INPUT_POST,'clientPassword2',FILTER_SANITIZE_STRING); $date = date('Y-m-d H:i:s'); $data = array( 'ru_username' => $clientUsername, 'ru_email' => $clientEmail2, 'ru_phone' => $clientPhone2, 'ru_password' => $clientPassword, 'ru_web' => 'academicwritingpro', 'created' => $date, ); global $wpdb; if ($wpdb->insert('registered_users',$data)) { $registered_user_id = $wpdb->insert_id; session_start(); $_SESSION["user_id"] = $registered_user_id; $_SESSION["username"] = $clientUsername; $_SESSION["web"] = 'academicwritingpro'; echo "success"; echo ""; } else { echo "error"; } die(); } elseif($level == 'signupusernameemail'){ $ru_username = filter_input(INPUT_POST,'clientUsername',FILTER_SANITIZE_STRING); $ru_email = filter_input(INPUT_POST,'clientEmail2',FILTER_SANITIZE_STRING); global $wpdb; $sql = "SELECT * FROM registered_users WHERE (ru_username='".$ru_username."' OR ru_email='".$ru_email."') AND ru_web='academicwritingpro' LIMIT 1"; $result = $wpdb->get_results($sql); if (count($result) > 0) { foreach($result as $key => $row) { if($row->ru_username == $ru_username && $row->ru_email == $ru_email) { echo 'both'; }elseif($row->ru_username == $ru_username) { echo 'username'; }elseif($row->ru_email == $ru_email) { echo 'email'; } } } else { echo "available"; } die(); } elseif($level == 'signupregistrationform'){ $clientUsername = filter_input(INPUT_POST,'clientUsername',FILTER_SANITIZE_STRING); $clientEmail2 = filter_input(INPUT_POST,'clientEmail2',FILTER_SANITIZE_STRING); $clientPhone2 = filter_input(INPUT_POST,'clientPhone2',FILTER_SANITIZE_STRING); $clientPassword = filter_input(INPUT_POST,'clientPassword',FILTER_SANITIZE_STRING); $clientPassword2 = filter_input(INPUT_POST,'clientPassword2',FILTER_SANITIZE_STRING); $date = date('Y-m-d H:i:s'); $data = array( 'ru_username' => $clientUsername, 'ru_email' => $clientEmail2, 'ru_phone' => $clientPhone2, 'ru_password' => $clientPassword, 'ru_web' => 'academicwritingpro', 'created' => $date, ); global $wpdb; if ($wpdb->insert('registered_users',$data)) { $registered_user_id = $wpdb->insert_id; session_start(); $_SESSION["user_id"] = $registered_user_id; $_SESSION["username"] = $clientUsername; $_SESSION["web"] = 'academicwritingpro'; //php mailer variables $messageConf = "Congratulations. Your Registration is complete. \r\n Your Cred are: \r\n Name: $clientUsername / $clientEmail2 \r\n PW: $clientPassword "; $to = $clientEmail2; $email = "info@academicwritingpro.com"; $subject = "Signup Confirmation in AWP"; $headers = 'From: '. $email . "\r\n" . 'Reply-To: ' . $email . "\r\n"; //Here put your Validation and send mail //$sent = wp_mail($to, $subject, strip_tags($messageConf), $headers); //The url you wish to send the POST request to $url = "https://academicwritingpro.com/admin/mailSendApi.php"; //The data you want to send via POST $fields = [ 'subject' => $subject, 'textmsg' => $messageConf, 'email_to' => $to ]; //url-ify the data for the POST $fields_string = http_build_query($fields); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, true); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); //So that curl_exec returns the contents of the cURL; rather than echoing it curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); //execute post $result = curl_exec($ch); //echo $result; echo "success"; //echo ""; } else { echo "error"; } die(); } elseif($level == 'clientResetPassword') { $ru_email = filter_input(INPUT_POST,'ru_email',FILTER_SANITIZE_STRING); $ru_newpassword = filter_input(INPUT_POST,'ru_password',FILTER_SANITIZE_STRING); $ru_confirmpassword = filter_input(INPUT_POST,'ru_confirmpassword',FILTER_SANITIZE_STRING); global $wpdb; $getDataQuery = $wpdb->get_results("SELECT * FROM registered_users WHERE ru_email='".$ru_email."' AND ru_web='academicwritingpro' LIMIT 1"); if(count($getDataQuery) > 0) { // output data of each row session_start(); foreach($getDataQuery as $key => $row) { $userId = $row->id; $useremail = $row->ru_email; $userOldpassword = $row->ru_password; } //echo 'success'; $wpdb->update('registered_users', array('ru_password'=>$ru_confirmpassword), array('id' => $userId)); //php mailer variables $messageConf = "Congratulations. Your PW is Successfully Updated. \r\n Now Your Cred are: \r\n name: $useremail \r\n Pw: $ru_confirmpassword "; $to = $useremail; $email = "info@academicwritingpro.com"; $subject = "PW Confirmation in AWP"; //$headers = 'From: '. $email . "\r\n" . // 'Reply-To: ' . $email . "\r\n"; //Here put your Validation and send mail //$sent = wp_mail($to, $subject, $messageConf, $headers); //$to = "malikfaisal544@gmail.com"; //$subject = "My test subject"; //$messageConf = "password change!"; $headers = "From: info@academicwritingpro.com" . "\r\n" . "cc: info@academicwritingpro.com" . "\r\n" . "Reply-To: info@academicwritingpro.com"; //$sent = mail($to,$subject,$messageConf,$headers); //The url you wish to send the POST request to $url = "https://academicwritingpro.com/admin/mailSendApi.php"; //The data you want to send via POST $fields = [ 'subject' => $subject, 'textmsg' => $messageConf, 'email_to' => $to ]; //url-ify the data for the POST $fields_string = http_build_query($fields); //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL, $url); curl_setopt($ch,CURLOPT_POST, true); curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); //So that curl_exec returns the contents of the cURL; rather than echoing it curl_setopt($ch,CURLOPT_RETURNTRANSFER, true); //execute post $result = curl_exec($ch); //echo $result; $data = array( 'rurpr_userId' => $userId, 'rurpr_useremail' => $useremail, 'rurpr_oldpassword' => $userOldpassword, 'rurpr_newpassword' => $ru_newpassword, 'rurpr_newconfirmpassword' => $ru_confirmpassword, 'rurpr_status' => 'approved', 'rurpr_notification' => 'unseen', ); if ($wpdb->insert('registered_users_resetPassReq',$data)) { $registered_user_id = $wpdb->insert_id; echo "success"; } else { echo "error"; } }else{ echo "notfound"; } die(); } } }else{ // echo "no"; //echo $_SESSION["username"]; echo ""; exit(); } ?>

Login & Sign Up

 

error: Content is protected !!