Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> formularz kontaktowy nie działa :(
tylkospokojnie
post 13.01.2008, 16:40:48
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 13.01.2008

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


Witam,
robie srone www, na stronie ma byc formularz kontaktowy mam tu taki plik contact.php czy ktos mi moze powiedziec jak go zmienic zeby maile dochodziły na mój mail?

<?php
Error_Reporting(E_ALL & ~E_NOTICE);

while ($request = current($_REQUEST)) {
if (key($_REQUEST)!='recipient') {
$pre_array=split ("&777&", $request);

$post_vars[key($_REQUEST)][0]=preg_replace ("/<[^>]*>/", "", $pre_array[0]);
$post_vars[key($_REQUEST)][1]=preg_replace ("/<[^>]*>/", "", $pre_array[1]);
}
next($_REQUEST);
}



reset($post_vars);


$subject="From ".$post_vars['your_name'][0] ;
$headers= "From: ".$post_vars['your_email'][0] ."\n";
$headers.='Content-type: text/html; charset=iso-8859-1';
$message='';
while ($mess = current($post_vars)) {
if ((key($post_vars)!="i") && (key($post_vars)!="your_email") && (key($post_vars)!="your_name")) {

$message.="<strong>".$mess[1]."</strong>&nbsp;&nbsp;&nbsp;".$mess[0]."<br>";
}
next($post_vars);
}

mail($_REQUEST['recipient'], $subject, "
<html>
<head>
<title>Contact letter</title>
</head>
<body>
<br>
".$message."
</body>
</html>" , $headers);
echo ("Your message was successfully sent!");

?>
<script>
resizeTo(300, 300);
Go to the top of the page
+Quote Post
lord_t
post 13.01.2008, 16:49:06
Post #2





Grupa: Zarejestrowani
Postów: 603
Pomógł: 131
Dołączył: 24.07.2007
Skąd: Górny Śląsk

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


php.net: mail()

Przeczytaj.


--------------------
Go to the top of the page
+Quote Post
Maxik
post 13.01.2008, 16:54:31
Post #3





Grupa: Zarejestrowani
Postów: 726
Pomógł: 129
Dołączył: 10.01.2008
Skąd: Gdańsk

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


  1. <?php
  2. if ($_POST['title'] and $_POST['tresc'] and $_POST['ymail']){
  3. $title = $_POST['title'];
  4. $tresc = $_POST['tresc'];
  5. $ymail = $_POST['ymail'];
  6.  
  7. if (mail("twój mail", $title, $tresc, "From <'$ymail'>")) {
  8. echo "<font color=\"green\"><B>Wiadomość została wysłana</B></font>";
  9. }
  10. else {
  11. echo "Błąd wysyłania";
  12. }
  13. }
  14. else {
  15. echo "Wypełnij formularz poniżej";
  16. }
  17. echo "
  18. <form method=\"post\">
  19. <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  20. <tr>
  21. <td>Twój e-mail:</td>
  22. <td><input type=\"text\" name=\"ymail\" size=\"40\" /></td>
  23. </tr>
  24. <tr>
  25. <td>Tytuł listu:</td>
  26. <td><input type=\"text\" name=\"title\" size=\"40\" /></td>
  27. </tr>
  28. <tr>
  29. <td>Treść listu:</td>
  30. <td><textarea rows=\"10\" cols=\"40\" name=\"tresc\">Wpisz treść listu</textarea></td>
  31. </tr>
  32. </table>
  33. <input type=\"submit\" value=\"Wyślij\">
  34. </form>";
  35.  
  36. ?>


--------------------
Pomogłem? Kliknij przycisk Pomógł pod pomocnym Ci postem.
http://maxik.me/
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 09:08