Salve a tutti,
ho effettuato un cambio hosting (aruba) da windows a linux e dopo il passaggio lo script che usavo per inviare mail (flash+php) non funziona più.
Questo è il messaggio che mi da il Log degli errori di aruba:
Codice PHP:
Fri Dec 02 20:05:06 2011] [error] [client 79.25.12.41] PHP Warning: array_reverse()
expects parameter 1 to be array, null given
in /web/htdocs/www.indirizzosito.com/home/mail_1.php on line 14
mentre questa è la riga 14 del suddetto file php:
Codice PHP:
$array=array_reverse($array,true);
Qui sotto invece tutto il codice del file mail_1.php
Codice PHP:
function parse_form($array) {
$reserved_keys[] = "onLoad";
$reserved_keys[] = "contenitore";
$reserved_keys[] = "titolo";
$array=array_reverse($array,true);
if (count ($array)) {
while (list($key, $val) = each($array)) {
$reserved_violation = 0;
for ($ri=0; $ri<count($reserved_keys); $ri++) {
if ($key == $reserved_keys[$ri]) {
$reserved_violation = 1;
}
}
if ($reserved_violation != 1) {
if (is_array($val)) {
for ($z=0;$z<count($val);$z++) {
$content .= "$key: $val[$z]\n";
}
} else {
$content .= "$key: $val\n";
}
}
}
}
return $content;
}
$content = parse_form($HTTP_POST_VARS);
if (($Email_1) || ($EMAIL_1)) {
$Email_1 = trim($Email_1);
if ($EMAIL_1)
$Email_1 = trim($EMAIL_1);
if (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $Email_1)) {
echo "error=1";
$EMAIL_1 = $Email_1;
} else {
mail($contenitore, stripslashes($titolo), stripslashes($content), "From: Sito\r\nReply-To: $Email_1\r\nX-Mailer: DT_formmail");
echo "success=1";
}
}
exit;
?>
Qualcuno sa come si potrebbe rimediare all'errore? è un pò che ci sbatto la testa..
Grazie
Nico