📁 File Manager
Editing:
/home/u882412079/domains/zendeskglobal.com/public_html/contact_mail.php
<?php session_start(); include 'include/connection.php'; if (isset($_POST['Submit_Btn'])) { $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $subject = $_POST['subject']; $message = $_POST['message']; $to = "services@zendeskglobal.com"; $message = " <html> <head> <title>HTML email</title> </head> <body> <p>Website mail</p> <table> <tr> <th>Firstname</th> <th>".$name."</th> </tr> <tr> <td>Email</td> <td>".$email."</td> </tr> <tr> <td>Phone</td> <td>".$phone."</td> </tr> <tr> <td>Subject</td> <td>".$subject."</td> </tr> <tr> <td>Message</td> <td>".$message."</td> </tr> </table> </body> </html> "; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: <webmaster@example.com>' . "\r\n"; // $headers .= 'Cc: myboss@example.com' . "\r\n"; if(mail($to,$subject,$message,$headers)){ // $_SESSION['msg'] = '<div class="alert alert-success"> // <strong>Success!</strong> Your request has been sent. // </div>'; // header("Location:contact.php"); } // else{ // $_SESSION['msg'] = '<div class="alert alert-danger"> // <strong>Sorry!</strong> Your request has not been sent. Please try again // </div>'; // header("Location:contact.php"); // } date_default_timezone_set('Asia/Kolkata'); $created_at = date('Y-m-d h:i:s'); $query = $conn->prepare("INSERT INTO contact(name,email,phone,subject,message,created_at) values(:name,:email,:phone,:subject,:message,:created_at)"); $query->bindParam(':name',$name); $query->bindParam(':email',$email); $query->bindParam(':phone',$phone); $query->bindParam(':subject',$subject); $query->bindParam(':message',$message); $query->bindParam(':created_at',$created_at); if ($query->execute()) { $_SESSION['msg'] = '<div class="alert alert-success"> <strong>Success!</strong> Thanks for the message. One of our associate will contact you within 3 business days regarding your query. </div>'; // header("Location:contact.php"); ?> <meta http-equiv="Refresh" content="0; url=contact.php"> <?php }else{ $_SESSION['msg'] = '<div class="alert alert-danger"> <strong>Success!</strong> Your request has not been sent. Please try again </div>'; // header("Location:contact.php"); ?> <meta http-equiv="Refresh" content="0; url=contact.php"> <?php } }else{ // header("Location:contact.php"); ?> <meta http-equiv="Refresh" content="0; url=contact.php"> <?php } ?>
Save
Cancel