<?php
session_start();
include("./../../config/config.php");
$myIp= ipCheck();
$name		=   secureSuperGlobalPOST($_REQUEST[SESS_MASTER.'name']);
$emailid		=   secureSuperGlobalPOST($_REQUEST[SESS_MASTER.'emailid']);
$subject	=   secureSuperGlobalPOST($_REQUEST[SESS_MASTER.'subject']);
$message	=   secureSuperGlobalPOST($_REQUEST[SESS_MASTER.'message']);


 if($_POST){
  try{
     
          $olgaquery="INSERT INTO contact_form SET createdIp='$myIp',username='$name',email='$emailid',subjects='$subject',messages='$message'"; 
		$stmt = $conn->prepare($olgaquery);
		if($stmt->execute()){
			//$last_insert_id = $conn->lastInsertId();

			$_SESSION["created"] = "save Successfully" ;
			
			 echo "<script>window.location='../../contact';</script>";;
		}
    }
 // show error
 catch(PDOException $exception){
    die('ERROR: ' . $exception->getMessage());
}
}


?>
