Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] syntax error - klasa
hhg
post 7.01.2007, 04:11:25
Post #1





Grupa: Zarejestrowani
Postów: 316
Pomógł: 0
Dołączył: 5.07.2006

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


napisalem moja pierwsza w zyciu klase i od razu dostaje blad smile.gif

Cytat
Parse error: syntax error, unexpected T_VARIABLE in /home/bart/public_html/mailing/mail.class.php on line 5
gdzie 5 linia wskazuje na pierwszy przypisanie w klasie

nie pisze ze ta klasa jest juz gotowa ale prosze o wskazowki co moze jeszcze nie zadzialac, i czy te 'public' powinienem gdzies powinienem zmienic na inne?

z gory dzieki za pomoc
  1. <?php
  2.  
  3. class site
  4. {
  5. public $ip = $_SERVER['REMOTE_ADDR'];
  6. public $host = $gethostbyaddr($this->ip);
  7.  
  8. public $subject;
  9. public $firm;
  10. public $name;
  11. public $telephone;
  12. public $sender;
  13. public $receiver;
  14.  
  15. public function validate($attribute)
  16. {
  17. if (empty($attribute))
  18. return false;
  19. else
  20. return true;
  21. }
  22.  
  23. public $text = nl2br("
  24. Wiadomosc od: $this->sender
  25. Firma: $this->firm
  26. Telefon: $this->telephone
  27. Imie i nazwisko: $this->name
  28.  
  29. $this->text;
  30.  
  31. IP nadawcy: $this->ip
  32. HOST nadawcy: $this->host
  33. ");
  34.  
  35. public function $mailto()
  36. {
  37.  
  38. if (!(validate($this->subject) && validate($this->firm) && validate($this->name) && validate($this->telephone) && validate($this->sender) && validate($this->receiver)))
  39. {
  40. echo "Wszystkie pola sa wymagane. Popaw wprowadzone dane!";
  41. exit();
  42. }
  43.  
  44. $headers = "MIME-Version: 1.0 rn Content-type: text/html; charset=iso-8859-2 rn From: $this->sender rn";
  45.  
  46. if (mail($this->receiver;$this->subject;$this->text;$headers))
  47. echo "email zostal pomyslnie wyslany";
  48.  
  49. }
  50.  
  51. }
  52.  
  53.  
  54.  
  55.  
  56. ?>


Ten post edytował hhg 7.01.2007, 04:17:14
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 Wersja Lo-Fi Aktualny czas: 14.08.2025 - 13:27