Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]błąd w class - serwer zwraca błąd, edytor wskazuje na poprawną składnie
agata
post
Post #1





Grupa: Zarejestrowani
Postów: 53
Pomógł: 0
Dołączył: 4.12.2009

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


witam,
prosiłabym o pomoc.

Mam klasę wysyłającą maila, w Netbeans kod jest w porządku jednak na serwerze nie jest wykonywany z powodu błędu.

Błąd który dostaje to:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /var/www/sites/yoyo.pl/p/a/pablo83/class.emailer.php on line 11

o to class:
  1. <?php
  2. class Emailer {
  3.  
  4. private $sender;
  5. private $recipients;
  6. private $subject;
  7. private $body;
  8.  
  9. function __construct($sender) {
  10. $this->sender = $sender;
  11. $this->recipients = array();
  12. }
  13. public function addRecipients($recipients){
  14. array_push($this->recipients, $recipients);
  15. }
  16. public function setSubject($subject){
  17. $this->subject = $subject;
  18. }
  19. public function setBody($body){
  20. $this->body = $body;
  21. }
  22. public function sendEmail(){
  23. foreach ($this->recipients as $recipients)
  24. {
  25. $results = mail($recipients, $this->subject, $this->body, "From: {$this->sender}\r\n");
  26. if ($results) echo "Wiadomość została wysłana do {$recipients}<br/>";
  27. }
  28. }
  29.  
  30. }
  31. ?>


Czym jest spowodowany powyższy błąd? może to być winą innej wersji php na serwerze?
serwer to:

yoyo.pl

Proszę o pomoc
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 - 11:05