🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #169587

Sendformmail.php nie wysyła maili (po aktualizacji php na serwerze)

#169587
From: Elmo Killer
Date: Wed, 22 Feb 2006 17:43
62 lines
2481 bytes
Witam,

od pewnego czasu nie dochodzą do mnie maile/wiadomości wysłane z formularza
wykorzystującego skrypt sendformmail.php. Admin twierdzi ze to wina skryptu,
który po aktualizacji php na serwerze przestał działać... ale na innych
serwerach skrypt działa idealnie.
Mógłby ktoś zerknąć na kod skryptu czy jest wszystko ok?

Z góry dziękuję za wszelką pomoc
Pozdr.
Jacek
-------------------------------------------------------

<?

function error($error) {
?>
 <html> <head>
 <meta http-equiv="Content-type" content="text/html; charset=ISO-8859-2">
 </head> <body> <? echo $error ?> </body>
 </html>
<?
 exit;
}
if($email == "") {
 $error = "Nie został podany adres na który ma być wysłany email z danymi z
formularza.";
 error($error);
}
if($require != "") {
 $separator = ",";
 for($item = strtok($require,$separator);
  $item;
  $item = strtok($separator)) {
   $items[$item]++;
 }
}
while(list($key,$val) = each($HTTP_POST_VARS)) {
 if(($key != 'send') and ($key != 'email') and ($key != 'subject') and ($key
!= 'require') and ($key != 'location')) {
  if(gettype($items) == 'array') {
   reset($items);
   while(list($key2,$val2) = each($items)) {
    if(($key == $key2) and ($val == "")) {
     $error = "Nie zostało wypełnione pole $key.";
     error($error);
    }
   }
  }
  $body .= "$key:\n$val\n\n";
 }
}
mail($email,$subject,$body,"From: Klient");

if($location == "") {
 $error = "BَD!!! NIE WYPEŁNIONO WSZYSTKICH PÓL PRAWIDŁOWO. SPRÓBUJ JESZCZE
RAZ.";
 error($error);
} else {
 header("Location: $location");
}
?>
Technical Details
Message-ID: <dti7t3$5le$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.gazeta.pl!not-for-mail
From: "Elmo Killer" <redbat@wp.pl>
Newsgroups: pl.comp.lang.php
Subject: Sendformmail.php nie wysyła maili (po aktualizacji
 php na serwerze)
Date: Wed, 22 Feb 2006 18:43:07 +0100
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 64
Message-ID: <dti7t3$5le$1@inews.gazeta.pl>
NNTP-Posting-Host: 195.116.149.253
X-Trace: inews.gazeta.pl 1140630244 5806 195.116.149.253 (22 Feb 2006 17:44:04 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Wed, 22 Feb 2006 17:44:04 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-Priority: 3
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-User: jacekdworak
X-MSMail-Priority: Normal
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit