Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.88 KB | None | 0 0
  1. <?php
  2. include '../includes/include.php';
  3.  
  4. if (isset($_POST['submit']))
  5. {
  6.         $cat = mysqli_real_escape_string($db, $_POST['cat']);
  7.         $subject = mysqli_real_escape_string($db, $_POST['subject']);
  8.         $message = mysqli_real_escape_string($db, $_POST['message']);
  9.         $id = $info['id'];
  10.         $now = date('Y-m-d');
  11.         $replied = $info['fname'] . ' ' . $info['lname'];
  12.  
  13.         $q = "INSERT INTO `tickets` (uid, cat, subject, message, created, who) VALUES ('$id', '$cat', '$subject', '$message', '$now', '$replied')";
  14.         $db->query($q);
  15.  
  16.                 $email = $info['email'];
  17.                 $headers  = 'MIME-Version: 1.0' . "\r\n";
  18.                 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  19.                 $headers .= 'From: AFR Virtuel <noreply@afrvirtuel.net>' . "\r\n";
  20.                 $content = "<html><body><img src='http://afrvirtuel.net/assets/images/web_logo_new.png' style='width: 250px;height:60px;'><br /></br>
  21.                        <font face='arial'>
  22.                        Dear ".$info['login']." - ".$info['fname']." ".$info['lname'].",<br /><br />
  23.                        Your New ticket titled: \"".$subject."\" has been submited! You will recieve email updates when an admin replies to your ticket! To check the status of your ticket anytime please login to your Pilot Operations Center and click on the \"Support Center\" tab!<br /><br />
  24.                        Thanks,<br />
  25.                        AFR Virtuel Executive Staff<br />
  26.                        <a href='mailto:info@afrvirtuel.net'>info@afrvirtuel.net</a>
  27.                        </font>
  28.                        </body>
  29.                        </html>";
  30.                 mail($email, 'AFR Virtuel - Ticket Created!', $content, $headers);
  31.  
  32.         header("Location: /?content=support&m=1");
  33.  
  34. } else
  35. {
  36.  
  37.         die("Direct access not permitted!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement