Skrypt który zrobilem sam.
Demo: LINK
Download: LINK

index.php
  1. <?php
  2.  
  3. require_once("cfg.php");
  4.  
  5. ?>
  6. <html>
  7. <head>
  8.  
  9. <title>Kontakt</title>
  10. <script type='text/javascript' src='js_kontakt.js'></script>
  11.  
  12. </head>
  13. <body>
  14.  
  15. <form action='#'>
  16.  
  17. <input type='button' id='contact_button' value='Show Contact' /><br />
  18. <input type='button' id='contactform_button' value='Show Contact Form' />
  19.  
  20. </form>
  21.  
  22. <div id='contact_show' style='display: none'><font face='Arial' size='2'><b>Kontakt:</b><br /><img src='gg.png' width='20' height='20' /> <?php echo $nrgg; ?><br /><img src='email.png' width='20' height='20' /> <?php echo $adresemail; ?></font></div>
  23. <div id='showcontact_form' style='display: none'><font face='Arial' size='2'><br /><b>Formularz kontaktowy:</b><br /><?php include("form.php"); ?></font></div>
  24.  
  25. </body>
  26.  
  27. </html>


form.php
  1. <?php
  2.  
  3. require_once("cfg.php");
  4.  
  5. $submit = $_POST['submit'];
  6. $email = $_POST['email'];
  7. $text_wiadomosci = strip_tags($_POST['text']);
  8. $temat = $_POST['temat'];
  9. $date = date("Y-m-d h:i:s");
  10. $text_nums = strlen($text_wiadomosci);
  11.  
  12.  
  13. //mail() info
  14. $subject = "-- $temat -- PosredniaK - KONTAKT";
  15. $message = "To jest kopia wiadomosc ktora do nas wyslales:\n
  16. ----------------------------------------------
  17. Temat: $temat\n
  18. Tresc: $text_wiadomosci\n
  19. Data: $date\n
  20. ----------------------------------------------";
  21. $headers = "From: $adresemail" . "\r\n" .
  22. "Reply-To: $adresemail" . "\r\n" .
  23. 'X-Mailer: PHP/' . phpversion();
  24. if($text_nums <= 250) {
  25.  
  26.  
  27. if($submit) {
  28.  
  29. if(mail($email, $subject, $message, $headers)){
  30.  
  31. die('<font face="Arial" size="2">OK! Wiadomosc zostala wyslana poprawnie!</font>');
  32.  
  33. } else {
  34.  
  35. die('<font face="Arial" size="2">Blad! Sprobuj ponownie!</font>');
  36.  
  37. }
  38. }
  39. } else {
  40.  
  41. echo "<font face='Arial' size='2'>Tekst moze zawierac max 250 znakow</font>";
  42.  
  43. }
  44.  
  45. ?>
  46.  
  47. <html>
  48. <head>
  49. <title><?php echo $webname; ?> - KONTAKT</title>
  50. </head>
  51. <body>
  52. <form action='form.php' method='POST'>
  53. <table>
  54. <tr>
  55. <td><font face="Arial" size="2">Twoj e-mail:</font></td>
  56. <td><input type='text' name='email' size='20' /></td>
  57. </tr>
  58. <tr>
  59. <td><font face="Arial" size="2">Temat:</font></td>
  60. <td>
  61. <select name='temat'>
  62. <option><?php echo $temat1; ?></option>
  63. <option><?php echo $temat2; ?></option>
  64. <option><?php echo $temat3; ?></option>
  65. </select>
  66. </td>
  67. </tr>
  68.  
  69. <tr>
  70. <td><font face="Arial" size="2">Tresc:</font></td>
  71. <td><textarea name='text'></textarea></td>
  72. </tr>
  73. <tr>
  74. <td></td>
  75. <td><input type='submit' name='submit' value='wyslij' /></td>
  76. </tr>
  77. </table>
  78. </form>
  79. </body>
  80. </html>


cfg.php
  1. <?php
  2.  
  3. $nrgg = 9707426;
  4. $adresemail = 'killer99977@wp.pl';
  5. $temat1 = 'Zlecenie';
  6. $temat2 = 'Pomoc';
  7. $temat3 = 'Skarga';
  8. $webname = 'PosredniaK';
  9.  
  10. ?>