Riporto il log degli errori del formMail che sto usando.
Non è quello "ufficiale" del servizio di hosting che sto usando, quindi potrebbe non funzionare affatto
codice:
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 5: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 7: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 8: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 11: /tmp/27666/messaggioOK27666.txt: No such file or directory, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 30: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 32: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 33: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 34: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 51: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /bin/cat: /tmp/27666/messaggioOK27666.txt: No such file or directory, referer: http://www.xxxxxxxx.it/contatti.php
[Mon May 08 22:37:31 2006] [error] [client xx.xx.xxx.xx] /var/qmail/bin/check_body.sh: line 55: /tmp/badbodies.log: Permission denied, referer: http://www.xxxxxxxx.it/contatti.php
Questo è il form mail che sto usando (e che presso un altro hoster funzionava)
Codice PHP:
<?php
/**********************************/
/* EMAIL CONTACT FORM */
/* VERSION 1.1 */
/* Copyright 2004 (c) Epleweb.com */
/**********************************/
/* GNU General Public License
--------------------------------------------------------------------
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
if ($_POST['submit'] == TRUE) {
$receiverMail = "francesco.murer@gmail.com";
$name = stripslashes(strip_tags($_POST['name']));
$email = stripslashes(strip_tags($_POST['email']));
$subject = stripslashes(strip_tags($_POST['subject']));
$msg = stripslashes(strip_tags($_POST['msg']));
$ip = $_SERVER['REMOTE_ADDR'];
$msgformat = "From: $name ($ip)\nEmail: $email\n\n$msg";
if(empty($name) || empty($email) || empty($subject) || empty($msg)) {
echo "<h2>La e-mail non è stata inviata</h2>
Per favore riempi i campi richiesti</p>";
}
elseif(!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
echo "<h2>La e-mail non è stata inviata</h2>
L'indirizzo non è valido</p>";
}
elseif(mail($receiverMail, $subject, $msgformat, "From: $name <$email>")) {
echo "<h2>La e-mail è stata inviata!</h2>
Riceverai una risposta il prima possibile.</p>"; }
else {
echo "<h2>La e-mail non è stata inviata</h2>
Per favore prova ancora... Se il problema persiste c'è qualcosa che non va sul server.</p>";
}
}
else { ?>
<form method="post" action="">
<label for="name">Nome</label>
<input id="name" name="name" type="text" size="30" maxlength="40" />
<label for="email">E-mail</label>
<input id="email" name="email" type="text" size="30" maxlength="40" />
<label for="subject">Oggetto</label>
<input id="subject" name="subject" type="text" size="30" maxlength="40" />
<label for="message">Messaggio</label>
<textarea id="message" name="msg" cols="50" rows="6"></textarea>
<label for="submit"></label>
<input id="submit" class="button" type="submit" name="submit" value="Invia" />
</p>
</form>
<?php } ?>