Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] formilarz pocztowy, funkcja if
matyskiewicz
post
Post #1





Grupa: Zarejestrowani
Postów: 184
Pomógł: 3
Dołączył: 6.10.2006
Skąd: Poznań

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


Witam,
Napisałem funkcje wywylania maili:
  1. <?php
  2. function kontakt(){
  3. if ($_GET['id'] == 'administrator') {
  4. print $kontakt_admin;
  5. print '<table>';
  6. print '<tr>';
  7. print '<td>Imię i nazwisko</td>';
  8. print '<td><input name="imie" type="text" class="pole" /></td>';
  9. print '</tr>';
  10. if($_POST['imie'] == "") {
  11. print '<tr>';
  12. print '<td></td>';
  13. print '<td><div class="blad">Proszę podać imię, nazwisko, bądź ksywę.</div></td>';
  14. print '</tr>';
  15. } else {
  16. }
  17. print '<tr>';
  18. print '<td>Adres e-mail:</td>';
  19. print '<td><input name="email" type="text" class="pole" /></td>';
  20. print '</tr>';
  21. if($_POST['email'] == "") {
  22. print '<tr>';
  23. print '<td></td>';
  24. print '<td><div class="blad">Proszę podać poprawny adres e-mail.</div></td>';
  25. print '</tr>';
  26. } else {
  27. }
  28. print '<tr>';
  29. print '<td>Temat:</td>';
  30. print '<td><input name="temat" type="text" class="pole" /></td>';
  31. print '</tr>';
  32. print '<tr>';
  33. print '<td>Treść:</td>';
  34. print '<td><textarea name="tresc" class="textarea"> </textarea></td>';
  35. print '</tr>';
  36. if($_POST['tresc'] == "") {
  37. print '<tr>';
  38. print '<td></td>';
  39. print '<td><div class="blad">Proszę wpisać treść wiadomości.</div></td>';
  40. print '</tr>';
  41. } else {
  42. }
  43. print '<tr>';
  44. print '<td></td>';
  45. print '<td><input type="submit" value="Wyślij" />&nbsp;&nbsp;&nbsp;<input type="reset" value="Wyczyść" /></td>';
  46. print '</tr>';
  47. print '</table>';
  48.  if (($_POST['imie'] != "") AND ($_POST['email'] != "") AND ($_POST['tresc'] != "")) { 
  49.  $wyslij = mail(".$mail_admin.",$_POST['temat'],$_POST['tresc'],"From: ".$_POST['imie']."<".$_POST['email'].">");
  50.  if ($wyslij) {
  51.  print "<script>alert ('Wiadomość została wysłana')</script>";
  52.  header("Location: kontakt.php?id=wyslane");
  53.  } else {
  54.  print "<script>alert ('UWAGA! Wystąpił błąd przy wysyłaniu.')</script>";
  55.  header("Location: kontakt.php?id=administrator");  
  56.  }
  57. } else {
  58. print 'Wystąpił błąd w otwieraniu strony. Prosimy ponformować <a href="'.$mail_admin.'" class="link">Administratora</a>.';
  59. }
  60. }
  61. ?>
Niewiem dlaczego ale na tej lini:
  1. <?php
  2. if (($_POST['imie'] != "") AND ($_POST['email'] != "") AND ($_POST['tresc'] != "")) {
  3. ?>

Parse error: syntax error, unexpected $end

wywala mi bład. Proszę o pomoc w rozwiazaniu problemu.

Ten post edytował matyskiewicz 29.10.2006, 21:46:44


--------------------
eclipse :)
Go to the top of the page
+Quote Post

Posty w temacie


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 Aktualny czas: 21.08.2025 - 07:30