Guest User

Untitled

a guest
Aug 5th, 2018
1,022
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <?php header('Content-Type: text/html; charset=utf-8'); ?>
  2. <html>
  3. <head>
  4.  
  5. <meta name="google" content="notranslate">
  6. <meta charset="UTF-8">
  7. <!--[if !mso]><!-- -->
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  9. <!--<![endif]-->
  10. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  11. <meta name="viewport" content="width=device-width, initial-scale=1">
  12. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  13. <!-- Custom style -->
  14. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css">
  15.  
  16. <link rel="stylesheet" type="text/css" href="css/custom.css">
  17. <style>
  18. pre {
  19. white-space: pre;
  20. white-space: pre-wrap;
  21. word-wrap: break-word;
  22. }
  23. </style>
  24. <?php include("assets/nav.php");
  25. include("assets/sqlconfig.php");?>
  26. </head>
  27. <body>
  28. <div class="alert alert-info alert-dismissable"><div style="background-color: #A3B86C; color: white; font-size: 20px;"><center><a href="functions/mailLoad.php">Click here to load Mail </a></center></div><div>
  29. <?php
  30.  
  31.  
  32. include("../assets/sqlconfig.php");
  33.  
  34. if(isset($_GET['emailUpdate'])){
  35. echo "<center>" . $_GET['emailUpdate'] . " New emails</center>";
  36. }
  37.  
  38. $conn = new mysqli($servername, $username, $password, $dbname);
  39. if ($conn->connect_error) {
  40. die("Connection failed: " . $conn->connect_error);
  41. }
  42.  
  43. $sql = "SELECT * FROM `mail` ORDER BY `email_number` DESC";
  44. $result = $conn->query($sql);
  45.  
  46. if ($result->num_rows > 0) {
  47. while($row = $result->fetch_assoc()) {
  48.  
  49.  
  50. $emailContentsVar = $row['email_message'];
  51. if ( base64_decode($emailContentsVar, true) == true){
  52. echo base64_decode($emailContentsVar);
  53. } else {
  54. echo "<div id='Emails' style='background-color: #F26D21; color: white;'>" . $emailContentsVar . "</div><br>";
  55. }
  56.  
  57. }
  58. } else {
  59. echo "0 results";
  60. }
  61.  
  62. $conn->close();
  63.  
  64. exit;
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. ?>
  78. <script>
  79. $(document).ready(function(){
  80.  
  81.  
  82. var ajaxurl = 'functions/mailLoad.php',
  83. data = {'action': 'load'};
  84. $.post(ajaxurl, data, function (response) {
  85. alert(response);
  86. });
  87. });
  88. <!-- Javascript -->
  89. <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  90. <script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
  91. <script>
  92. // $(".panel-heading").click(function(){
  93. // Holds the product ID of the clicked element
  94.  
  95. // });
  96. </script>
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment