Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Formularz kontaktowy
Eset96
post
Post #1





Grupa: Zarejestrowani
Postów: 40
Pomógł: 1
Dołączył: 23.03.2010

Ostrzeżenie: (0%)
-----


Witam, czy pomogłby ktoś przerobić ten skrypt tak, aby nie korzystał z bazy danych tylko żeby wysyłał maila na twojmail@gmail.com

  1. <?
  2. include 'config/config.php';
  3. if (!isset($_POST['send'])) {
  4. <form method="POST" action="index.php?p=contact">
  5. <table cellspacing="0" cellpadding="0" border="0" width="500">
  6.  
  7. <tr>
  8. <td class="rTabU" style="text-align: left; padding-left: 20px; color: #FFCC99;" width="475" colspan="2">
  9. Formularz kontaktowy</td>
  10. </tr>
  11. <tr>
  12. <td class="rTabP" width="200" style="text-align: right">Adres e-mail :</td>
  13. <td class="rTabP" width="417" style="text-align: left"><input type="text" name="mail" class="inputE" value=""></td>
  14. </tr>
  15. <tr>
  16. <td class="rTabP" width="200" style="text-align: right">Temat :</td>
  17. <td class="rTabP" width="417" style="text-align: left"><input type="text" name="subject" class="inputE" value=""></td>
  18. </tr>
  19. <tr>
  20. <td class="rTabP" width="200" style="text-align: right" valign="top">
  21. Wiadomosc :</td>
  22. <td class="rTabP" width="417" style="text-align: left">
  23. <textarea name="content" style="width: 380px; height: 120px;" rows="1" cols="20"></textarea>
  24. </td>
  25. </tr>
  26. <tr>
  27. <td class="rTabP" width="200" style="text-align: right" valign="top">
  28. Token :</td>
  29. <td class="rTabP" width="417" style="text-align: left">
  30. <img src="obrazek.php" width="135" height="15" alt="Przepisz token"></td>
  31. </tr>
  32. <tr>
  33. <td class="rTabP" width="200" style="text-align: right" valign="top">
  34. Wpisz token :</td>
  35. <td class="rTabP" width="417" style="text-align: left">
  36. <input type="text" name="token" class="inputE" value=""> </td>
  37. </tr>
  38. <tr>
  39. <td class="rTabP" width="617" colspan="2" style="text-align: right"><input type="submit" name="send" class="inputSu" value="Wyslij"></td>
  40. </tr>
  41. </table>
  42.  
  43. </form>
  44. Gadu-Gadu: <i>55555555</i>
  45. <img src="http://status.gadu-gadu.pl/users/status.asp?id=555555&styl=4" height="16" width="16">
  46. '; } else {
  47. $check_mail = $_POST["mail"];
  48. $e_mail = safe($_POST["mail"]);
  49. $topic = safe($_POST["subject"]);
  50. $tresc = safe($_POST["content"]);
  51. $ip=$_SERVER['REMOTE_ADDR'];
  52. if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $check_mail))
  53. {
  54. echo "<center>Wprowadzony adres email jest niepoprawny.</center>";
  55. } else {
  56. if($_POST['token'] == $_SESSION['token']) { // Sprawdza czy token przepisany poprawnie...
  57. $query = "INSERT INTO `contact_database` VALUES(0, NOW(),'$ip','$e_mail','$topic','$tresc','0')";
  58. if (@mysql_query ($query)) {
  59. } else { }
  60.  
  61. $Name = "eset"; //senders name
  62. $email = "twojmail@gmail.com"; //senders e-mail adress
  63. $recipient = "$e_mail"; //recipient
  64. $mail_body = "$tresc"; //mail body
  65. $subject = "tytyl"; //subject
  66. $header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields
  67.  
  68. mail($recipient, $subject, $mail_body, $header); //mail command :)
  69. echo "<center>Kopia wiadomosci zostala wyslana na adres: <b>$e_mail</b>.</center>";
  70. } else { print '<center>Blednie przepisany token</center>'; }
  71. }
  72.  
  73. }
  74. ?>


Z góry dzieki i pozdrawiam
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 14:28