Advertisement
Guest User

Untitled

a guest
Jan 12th, 2023
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.92 KB | None | 0 0
  1. <div style="display:none;">
  2. <div id="inline_feed">
  3. <?php
  4.  
  5. //error_reporting(0);
  6.  
  7. // Formular bol odoslany
  8. if ($_SERVER['REQUEST_METHOD'] === 'POST' AND isset($_POST['filled'])) {
  9. // Zbierame data z formu
  10. $data = array(
  11. 'Vorname' => $_POST['Vorname'],
  12. 'Nachname' => $_POST['Nachname'],
  13. 'Firma' => $_POST['Firma'],
  14. 'E-Mail' => $_POST['E-Mail'],
  15. 'area' => $_POST['area'],
  16. 'filled' => $_POST['filled'],
  17. );
  18.  
  19. // Checkovanie inputov ci su vyplnene
  20. $dataError = array();
  21. if (empty($data['Vorname'])) {
  22. $dataError['error_Vorname'] = '<div class="chybova">Fehler</div>';
  23. }
  24.  
  25. if (empty($data['Nachname'])) {
  26. $dataError['error_Nachname'] = '<div class="chybova">Fehler</div>';
  27. }
  28.  
  29. if (empty($data['Firma'])) {
  30. $dataError['error_Firma'] = '<div class="chybova">Fehler</div>';
  31. }
  32.  
  33. if (empty($data['E-Mail'])) {
  34. $dataError['error_E-Mail'] = '<div class="chybova">Fehler</div>';
  35. }
  36.  
  37. if (empty($data['area'])) {
  38. $dataError['error_area'] = '<div class="chybova">Fehler</div>';
  39. }
  40.  
  41. // Mame error?
  42. if (count($dataError) == 0) {
  43. $zahlavie = "Content-Type: text/html; charset=UTF-8 \n";
  44. $message = '
  45. <table cellpadding="5" border="0">
  46. <tr>
  47. <td bgcolor="#f4f4f4">Vorname: <strong>'.$data['Vorname'].'</strong></td>
  48. </tr>
  49.  
  50. <tr>
  51. <td bgcolor="#e6e6e6">Nachname: <strong>'.$data['Nachname'].'</strong></td>
  52. </tr>
  53.  
  54. <tr>
  55. <td bgcolor="#f4f4f4">Firma: <strong>'.$data['Firma'].'</strong></td>
  56. </tr>
  57.  
  58. <tr>
  59. <td bgcolor="#e6e6e6">E-Mail: <strong>'.$data['E-Mail'].'</strong></td>
  60. </tr>
  61.  
  62. <tr bgcolor="#e6e6e6">
  63. <td><b>Vaša správa:</b></td>
  64. <td colspan="2">'.$data['area'].'</td>
  65. </tr>
  66. </table>';
  67.  
  68. if (mail('[email protected]', 'Feedback', $message, $zahlavie, '[email protected]')) {
  69. echo '<div class="odoslane">Ihre Feedback wurde gesendet.</div>';
  70. } else {
  71. echo '<div class="neodoslane">Ein Fehler ist aufgetreten. Bitte versuchen Sie es später noch einmal.</div>';
  72. }
  73. }
  74. }
  75.  
  76. if (!isset($_POST['filled']) OR !(count($dataError) == 0)) {
  77. ?>
  78.  
  79. <form action="" method="POST">
  80. <label for="edit-submitted-vorname">Vorname: <span class="form-required" title="Dieses Feld wird benötigt.">*</span></label>
  81. <input type="text" name="Vorname" maxlength="128" />
  82. <?php if (isset($dataError) AND !(count($dataError) == 0) AND array_key_exists('error_Vorname', $dataError)) { echo $dataError['error_Vorname']; } ?>
  83.  
  84. <label for="edit-submitted-nachname">Nachname: <span class="form-required" title="Dieses Feld wird benötigt.">*</span></label>
  85. <input type="text" name="Nachname" maxlength="128" />
  86. <?php if (isset($dataError) AND !(count($dataError) == 0) AND array_key_exists('error_Nachname', $dataError)) { echo $dataError['error_Nachname']; } ?>
  87.  
  88. <label for="edit-submitted-firma">Firma: <span class="form-required" title="Dieses Feld wird benötigt.">*</span></label>
  89. <input type="text" name="Firma" maxlength="128" />
  90. <?php if (isset($dataError) AND !(count($dataError) == 0) AND array_key_exists('error_Firma', $dataError)) { echo $dataError['error_Firma']; } ?>
  91.  
  92. <label for="edit-submitted-e-mail">E-Mail: <span class="form-required" title="Dieses Feld wird benötigt.">*</span></label>
  93. <input type="text" name="E-Mail" maxlength="128" />
  94. <?php if (isset($dataError) AND !(count($dataError) == 0) AND array_key_exists('error_E-Mail', $dataError)) { echo $dataError['error_E-Mail']; } ?>
  95.  
  96. <label for="edit-submitted-feedback">Feedback: <span class="form-required" title="Dieses Feld wird benötigt.">*</span></label>
  97. <textarea name="area"></textarea>
  98. <?php if (isset($dataError) AND !(count($dataError) == 0) AND array_key_exists('error_area', $dataError)) { echo $dataError['error_area']; } ?>
  99. <div class="clear">&nbsp;</div>
  100. <input type="submit" name="filled" value="Speichern" id="submitbtn" class="form-submit">
  101. </form>
  102.  
  103. <?php
  104. }
  105. ?>
  106.  
  107. </div>
  108. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement