siemka!!! mam taki blad wiem ze to oznacza naglowki wyslane i ze niemoze zmodyfikowac informacji w ale jak to naprawic to niewiem niewiem:Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\WebServ\httpd\class.SimpleMail.php:84) in C:\Program Files\WebServ\httpd\admin_transact.php on line 93
to jest kod admin_transact.php
<?php
require('config.php');
require('class.SimpleMail.php');
if(isset($_POST['action'])) { switch($_POST['action']) {
case 'Dodaj nową listę mailingową':
$sql = "INSERT INTO ml_lists (listname) " .
"VALUES ('" .$_POST['listname']."')";
break;
case 'Usuń listę mailingową':
$sql = "DELETE FROM ml_lists WHERE ml_id=" . $_POST['ml_id'];
$sql = "DELETE FROM ml_subscriptions " .
"WHERE ml_id=" . $_POST['ml_id'];
or
die('Nie mogę usunąć subskrypcji listy mailingowej.' . mysql_error()); break;
case 'Wyslij wiadomosć';
if(isset($_POST['msg'], $_POST['ml_id'])) { $sql = "SELECT listname FROM ml_lists" .
"WHERE ml_id='" . $_POST['ml_id'] ."'";
$listname = $row['listname'];
} else {
$listname = "Główna";
}
$sql = "SELECT DISTINCT usr.email,usr.firstname.usr.user_id " .
"FROM ml_users usr " .
"INNER JOIN ml_subscriptions mls" .
"ON usr.user_id = mls.user_id " .
"WHERE mls.pending=0";
if ($_POST['ml_id'] != 'all') {
$sql .= "AND mls.ml_id=" .$_POST['ml_id'];
}
or
die('Nie potrafię uzyskać listy adresów email' .
$headers = "From: " . ADMIN_EMAIL ."r\n";
$ft = "Otrzymujesz tą wiadomosć jako członek listy mailingowej";
$ft .= $listname .".\n Jeżeli uważasz, że ten list został ";
$ft .= "wysłany pod zły adres lub\n chcesz usunąć ";
$ft .= "swój adres z listy mailingowej, odwiedż poniższy ";
$ft .= " link:\n";
$ft .= "http://" .$_SERVER['HTTP_HOST'].
dirname($_SERVER['PHP_SELF']) . "/remove.php?u=" . $row['user_id'] . "&ml=" . $_POST['ml_id'];
} else {
$ft = "Otrzymujesz tą wiadomosć bo zapisałes się do jednej";
$ft .= "lub wielu list mailingowych.\n Odwiedż poniższy ";
$ft .= "link, aby zmienic ustawienia swojej subskrypcji:\n";
$ft .= "http://" . $_SERVER['HTTP_HOST'] .
dirname($_SERVER['PHP_SELF']) . "/user.php?u=" . $row['user_id'];
}
$msg .= "--------------\n";
$msg .= $ft;
$email = new SimpleMail();
$email->send($row['email'],
$msg,
$headers)
or
die('Wysłanie emaila nie powiodło się.'); }
}
break;
}
}
header('Location: admin.php'); ?>
i podaje tez ten drugi kod tej clasy na wszelki wypadek
<?php
class SimpleMail {
public $to = NULL;
public $cc = NULL;
public $bcc = NULL;
public $from = NULL;
public $subject = '';
public $body = '';
public $htmlbody = '';
public $send_text = TRUE;
public $send_html = FALSE;
private $message = '';
private $headers = '';
public function send($to = NULL,
$subject = NULL,
$message = NULL,
$headers = NULL) {
$this->to = $to;
$this->subject = $subject;
$this->message = $message;
if ($headers) {
$this->headers = $headers;
}
} else {
if ($this->from) {
$this->headers .= "From: " . $this->from ."r\n";
}
if ($this->cc) {
$this->headers .= "Cc: " . $this->cc ."r\n";
}
if ($this->bcc) {
$this->headers .= "Bcc: " . $this->bcc ."r\n";
}
if ($this->send_text and !$this->send_html) {
$this->message = $this->body;
} elseif ($this->send_html and !$this->send_text) {
$this->message = $this->htmlbody;
$this->headers .= "MIME-Version: 1.0r\n";
$this->headers .= "Content-type: text/html;" .
"charset=iso-8859-2r\n";
} else {
$_boundary = "==MP_Bound_xyccr948x==";
$this->headers = "MIME-Version: 1.0r\n";
$this->headers .= "Content-type: multipart/alternative;" .
"boundary=\"$_boundary\"r\n";
$this->message = "Jest to wiadomosć wieloczęsciowa w" .
"formacie MIME\n";
$this->message .= "--$_boundary\n";
$this->message .= "Content-type: text/plain;" .
"charset=\"iso-8859-2\"\n";
$this->message .= "Content-Transfer-Encoding: 8bit\n\n";
$this->message .= $this->body . "\n";
$this->message .= "--$_boundary\n";
$this->message .= "Content-type: text/html;" .
"charset=\"iso-8859-2\"\n";
$this->message .= "Content-Transfer-Encoding: 8bit\n\n";
$this->message .= $this->htmlbody . "\n";
$this->message .= "--$_boundary--";
}
}
if (!mail($this->to.$this->subject,$this->message,$this->headers)) { throw new Exception('Wysłanie listu zakończone niepowodzeniem.');
return FALSE;
} else {
return TRUE;
}
}
}
?>
jezeli by mi ktos wyjasnil co musze poprawic bylbym wdzieczny pozdrawiam
Ten post edytował martino277 2.09.2007, 22:20:46