hjkhhrtertererrrrrerrtertertertertertertert
bnmbnerterterterterterdfgdfgdfgdfgdfgdfgdfgdfgdfg
/
home4
/
digil8bw
/
grapelegacy.com
/
Upload FileeE
HOME
<?php include_once('config/config.php'); if (!empty($_POST['offer_email'])) { $email = mysqli_real_escape_string($conn, test_input($_REQUEST['offer_email'])); $sql_offer = "Insert into offer_email set email='" . $email . "'"; $query_offer = mysqli_query($conn, $sql_offer); if ($query_offer) { $_SESSION['offerMail'] = "Your details submitted successfully"; $referer = $_SERVER['HTTP_REFERER']; header("Location: index.php"); exit(); } } if (!empty($_POST['email'])) { if (empty($_POST["name"])) { $_SESSION['msg1'] = "Please enter name"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } else { if (!preg_match("/^[a-zA-Z ]*$/", $_POST["name"])) { $_SESSION['msg1'] = "Only letters and whitespace allowed for name"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } } if (!filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) { $_SESSION['msg1'] = "Invalid email format"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } if (empty($_POST["message"])) { $_SESSION['msg1'] = "Please enter message"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } if (empty($_POST["phone"])) { $_SESSION['msg1'] = "Please enter phone"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } else { if (!is_numeric($_POST["phone"])) { $_SESSION['msg1'] = "Only numbers allowed for phone"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } if (!preg_match("/^[+]?[1-9][0-9]{9,14}$/", $_POST["phone"])) { $_SESSION['msg1'] = "Enter only 10 digit number for phone"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } } if (!empty($_POST['name']) && !empty($_POST['email']) && !empty($_POST['phone'] && !empty($_POST['message']))) { $name = mysqli_real_escape_string($conn, test_input($_REQUEST['name'])); $email = mysqli_real_escape_string($conn, test_input($_REQUEST['email'])); $phone = mysqli_real_escape_string($conn, test_input($_REQUEST['phone'])); $message = mysqli_real_escape_string($conn, test_input($_REQUEST['message'])); $sql = "Insert into contact set name='" . $name . "', email='" . $email . "', phone='" . $phone . "', message='" . $message . "', created=date('Y-m-d H:i:s')"; $query = mysqli_query($conn, $sql); if ($query) { $_SESSION['msg'] = "Your details submitted successfully"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } else { $_SESSION['msg1'] = "Something error"; $referer = $_SERVER['HTTP_REFERER']; header("Location: $referer"); exit(); } } } else { header("Location: index.php"); exit(); }