Salve a tutti.
Nel mio sito ho inserito un form che funziona tramite il seguente script php:
Codice PHP:
<?
// ------------- CONFIGURABLE SECTION ------------------------
// $mailto - set to the email address you want the form
// sent to, eg
//$mailto = "youremailaddress@example.com" ;
$mailto = 'webmaster@miosito.com' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback dal sito X" ;
$subject = "Feedback inviato dal sito X" ;
// the pages to be displayed, eg
//$formurl = "http://www.example.com/feedback.html" ;
//$errorurl = "http://www.example.com/error.html" ;
//$thankyouurl = "http://www.example.com/thankyou.html" ;
$formurl = "http://www.miosito.com/mail.php" ;
$errorurl = "http://www.miosito.com/errore.php" ;
$thankyouurl = "http://www.miosito.com/grazie.php" ;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );
if (!isset($_POST['email'])) {
header( "Location: $formurl" );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" );
header( "Location: $thankyouurl" );
exit ;
?>
Desidererei inserire in questo script qualcosa che mi faccia sapere l'indirizzo IP di chi mi sta scrivendo. Qualcuno è così gentile da aiutarmi?
Grazie in anticipo.
Ciao a tutti.