File manager - Edit - /home/custbahd/public_html/webs/monitor/contact/index.php
Back
<?php include_once 'conn.php'; if(isset($_POST['submit'])) { $sector = $_POST['sector']; $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $description = $_POST['description']; $sql = "INSERT INTO inquiries (sector,name,phone,email,description) VALUES ('$sector','$name','$phone','$email','$description')"; if (mysqli_query($conn, $sql)) { echo "<h1>Your message has been received. Thank you for your feedback!</h1>"; } else { echo "Error: " . $sql . " " . mysqli_error($conn); } mysqli_close($conn); } ?> <?php $from = 'Custom Assist Inc. <info@customassistinc.com>'; $fromName = 'Custom Assist Inc.'; $subject = "Message From Client"; $sector = $_POST["sector"]; $name = $_POST["name"]; $phone = $_POST["phone"]; $email = $_POST["email"]; $description = $_POST["description"]; // (B) NOT-SO-FRIENDLY WHEN SETTING FROM, CC, BCC, HTML MAIL, ETC... $headers = implode("\r\n", [ "MIME-Version: 1.0", "Content-type:text/html;charset=UTF-8", "From: Custom Assist Client <info@customassistinc.com>", "Cc: $from" ]); $mailBody="<b>Message for Custom Assist</b> <br><br> <b style='color:dodgerblue;'>Details</b><br><br> <b>Sector</b>: $sector <br><br> <b>Names</b>: $name<br><br> <b>Phone Number</b>: $phone <br><br> <b>Email address</b>: $email<br><br> <b>Description</b>: $description <br><br> <b align='center'>Custom Assist Inc. ©</b>"; $details ="<b style='color:dodgerblue;'>We'll contact you through the provided contact information.</b><br><br> <b>Names</b>: $name<br><br> <b>Phone Number</b>: $phone <br><br> <b>Email address</b>: $email<br><br> <b>Description</b>: $description <br><br> <b align='center'>Custom Assist Inc. ©</b>"; // Send email if(mail($from, $subject, $mailBody, $headers)){ echo ''; }else{ echo 'Email sending failed.'; } ?> <!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <title>Custom Assist Monitor Inquiries ©</title> <link rel="stylesheet" href="./style.css"> </head> <body> <h1>Your inquiry is stated as below;</h1> <?php if(isset($_POST['submit'])) { echo "$details"; } ?> <br> <br> <div class="box"> <a class="button" href="../">Home</a> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 1.6 |
proxy
|
phpinfo
|
Settings