Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: formularz kontaktowy nie działa :(
Forum PHP.pl > Forum > Przedszkole
tylkospokojnie
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);
lord_t
php.net: mail()

Przeczytaj.
Maxik
  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. ?>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.