Complaint Submission Status
include("conn.php"); if(isset($_POST['email'])) { $u=$_POST['txtuser']; echo $u; // Get cURL resource $curl = curl_init(); // Set some options - we are passing in a useragent too here curl_setopt_array($curl, array( CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'http://egunje.info/admin/addPoint.php', CURLOPT_USERAGENT => 'itell cURL Request', CURLOPT_POST => 1, CURLOPT_POSTFIELDS => array(userName => $u) )); // Send the request & save response to $resp $resp = curl_exec($curl); // Close request to clear up some resources curl_close($curl); if($resp == 1) { $state=$_POST['state']; //$lga=$_POST['lga']; $name=$_POST['name']; //echo $name; $phone=$_POST['phone']; //echo $lga; $email=$_POST['email']; $address=$_POST['address']; $city=$_POST['city']; //echo $state; $orgaddress=$_POST['orgAddress']; //echo $lga; $comnature=$_POST['comNature']; //$age=$_POST['age']; //echo $state; $sector=$_POST['sector']; //echo $lga; $department=$_POST['department']; $actioncomplaint=$_POST['actionRise']; $comprayer=$_POST['comPrayer']; $actiontaken=$_POST['actionTaken']; //$resisted=isset($_POST['resisted'])?$_POST['resisted']:null; $office=$_POST['office']; $rank=$_POST['rank']; $subjekt=$_POST['subjekt']; $when=$_POST['when']; //$process=$_POST['process']; $complain=$_POST['complain']; //$honest=isset($_POST['honest'])?$_POST['honest']:null; $detail=$_POST['detail']; $from=$_POST['from']; $subject=$_POST['subject']; $body=$_POST['body']; //include_once('captcha/cf.captcha.php'); // if(!check_captcha($_POST['setCaptcha'])){ // echo 'CAPTCHA CHECK: '.$error_captcha.''; // exit(); // }else{ // echo 'CAPTCHA CHECK: Correct...'; // //proceed // } function param($Name) { global $HTTP_POST_VARS; if(isset($HTTP_POST_VARS[$Name])) return($HTTP_POST_VARS[$Name]); return(""); } $from = param("from"); $to = param("email"); //$cc = param("cc"); //$bcc = param("bcc"); $subject = param("subject"); $body = param("body"); if($from != "" && $to != "" && $subject != "") { $headers = "From: " . $from . "\n" . "To: " . $to . "\n" . //"CC: " . $cc . "\n" . //"BCC: " . $bcc; mail("", $subject, $body, $headers); } ?> $date = date_create($when); $datepaid1 = date_format($date, 'Y-m-d H:i:s'); $sql="insert into complain(name,phone,email,address,cityId,stateId,complainNatureId,orgAddress,sectorId,departmentId,officeId,rankId,subjectId,complainCategoryId,complainDetails,target,actionComplaint,complainPrayer,actionTaken,dateHappen) values('$name','$phone','$email','$address','$city','$state','$comnature','$orgaddress','$sector','$department','$office','$rank','$subjekt','$complain','$detail','$target','$actioncomplaint','$comprayer','$actiontaken','$datepaid1')"; $result=mysql_query($sql,$connection) or die(mysql_error()); echo "Your Complaint Has Been Received!!!"; //header("location: index.php"); $message = "Dear $name,\nThank you for submitting your complaint. Your complaint has been received. You will receive feedback within 48 hours.\n\n\nRegards,\nitell4u Team."; $email = "$email"; $subject = "Complaint Received"; $header ="From: noreply@itell4u.net\n"; mail($email,$subject,$message,$header); } else{ var_dump($resp); echo "Communication error try again"; } } elseif(isset($_POST[''])) { echo "rubbish"; } ?>