volevo sapere come posso mettere all'interno del mio sito un area dove gli utenti possono scrivere un messaggio e inviarmelo sulla mia posta cliccando il tasto invia.
grazie:wink:
Printable View
volevo sapere come posso mettere all'interno del mio sito un area dove gli utenti possono scrivere un messaggio e inviarmelo sulla mia posta cliccando il tasto invia.
grazie:wink:
guarda questo post:
http://forum.it.altervista.org/php-m...vio-email.html
un esempio è questa pagina:
http://eurosalute.altervista.org/too..._form_mail.php
codice pagina aggiornato:
Codice PHP:
<?php
include("bbcode.php");
include("bbcode2.php");
if (count($_POST))//invio email solo se $_POST è diverso da zero o è settato
{
//CONTROLLO HACKERS
foreach(array('email') as $key) {$_POST[$key] = strip_tags($_POST[$key]);}
if(!is_secure($_POST)) {
$subject = "Hack Attempt via Contact Form!";
$body = " - Indirizzo IP: ".getenv("REMOTE_ADDR")."
- Agent: ".getenv("HTTP_USER_AGENT")."";
//QUI INSERISCI LA TUA EMAIL
$emailto = "eurosalute@altervista.org";
$headers = "From: $emailto";
//AVVERTI TE STESSO DELL'ATTACCO:
@mail($emailto, $subject, $body, $headers);
die("<br><br><font color=\"red\"><b>Asta la vista Hacker!</b></font><br><br>");
}
//end CONTROLLO HACKERS
$validate_email = true;
$filter_email = "/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/";
$contenuto_textarea = bbcode($_POST[note]);
$contenuto_textarea = strip_tags($contenuto_textarea,"<strong><em><u><img><a><marquee><object><param><embed><div>");
if (!preg_match($filter_email, $_POST[email])) {
echo ("<font color=\"red\"><b>Indirizzo email non valido!</b></font><br>");
$validate_email = false;
}
if (empty($contenuto_textarea)) {
echo ("<font color=\"red\"><b>Non hai scritto alcun messaggio!</b></font><br>");
$validate_email = false;
}
if ($validate_email)
{
//L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "eurosalute@altervista.org";//, ***@***.it";
//IL SOGGETTO DELLA MAIL
$subject = "Messaggio da $_POST[email]";
//CORPO DEL MESSAGGIO
//metti come commento il seguente $body:
//$body .= "\nMessaggio:\n__________\n" . @filter_var($_POST['note'], FILTER_SANITIZE_STRING);
//metti questo come $body:
$body = nl2br("\nMessaggio:\n__________\n".stripslashes($contenuto_textarea)."\n\nFrom: ".stripslashes($_POST[email])."\n__________\nFine Messaggio.");
//INTESTAZIONI SUPPLEMENTARI
$headers = "MIME-Version: 1.0\r\n" ;
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "From: $_POST[email]\r\n";
//INVIO
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "E-mail inviata con successo!<br><br>";
//stampo il messaggio inviato:
echo "<font color=\"\">$body</font><br><br>";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi.<br><br>";
//echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
}
}//end if $validate_email
}//end if (count($_POST)
//# NON CAMBIARE NIENTE QUI SOTTO:
function is_secure($ar) {
$reg = "/(Content-Type|Bcc|MIME-Version|Content-Transfer-Encoding)/i";
if(!is_array($ar)) {return preg_match($reg,$ar);}
$incoming = array_values_recursive($ar);
foreach($incoming as $k=>$v) if(preg_match($reg,$v)) return false;
return true;
}
function array_values_recursive($array) {
$arrayValues = array();
foreach ($array as $key=>$value) {
if (is_scalar($value) || is_resource($value)) {
$arrayValues[] = $value;
$arrayValues[] = $key;
}
elseif (is_array($value)) {
$arrayValues[] = $key;
$arrayValues = array_merge($arrayValues, array_values_recursive($value));
}
}
return $arrayValues;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Prova Form email</title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="rating" content="General">
<meta http-equiv="Content-Language" content="it">
<meta name="copyright" content="Copyright 2010, eurosalute.altervista.org">
<meta name="resource-type" content="document">
<meta name="Submission" CONTENT="http://eurosalute.altervista.org">
<meta name="Author" CONTENT="Webmaster">
<meta name="Subject" CONTENT="">
<meta name="ROBOTS" content="ALL">
<meta name="revisit-after" content="10 days">
<link href="http://classifieds.yourclickspaid.com/style/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="../js/windowstatus0.js"></script>
</head>
<body topmargin="0" leftmargin="0">
<div class="special">
<br>
<form action="prova_form_mail.php" method="POST" name="provaform">
<table border="0">
<tr>
<td valign="top"><font size="2" color="">*Tuo Indirizzo email:</font></td>
<td>
<input size="40" name="email" maxlength="45">
</td>
<tr>
<td valign="top"><font size="2" color="">*Messaggio da inviare:</font></td>
<td>
<?php textarea("note", "", "provaform");?>
<!--<textarea rows="10" name="note" cols="40"></textarea>-->
</td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="center" height="30">
<!-- qui ho aggiunto name="send" per if ($_POST['send'])-->
<input type="submit" value="Invia" name="send">
<input type="reset" value="Cancella"></td>
</tr>
</table>
</form>
</div>
</body>
</html>
ma il codice in php ho provato ad incollalrlo nella pagina ma quando aprro la pagina vedo solo le scritte che ho incollato e non il riquadro dove scrivere.
ho sbagliato qualchosa:?:
grazie
il codice di cui sopra, è esattamente il codice della pagina che vedi online, questa:
http://eurosalute.altervista.org/too..._form_mail.php
ed è una prova che avevo fatto....un esempio, che tu puoi modificare come vuoi, per es. puoi inserire altri campi :
- Tuo Nome
- Soggetto dell'email
ecc...
inoltre in questa pagina aiutando un altro utente, avevo anche installato un BBcode.....
ora se tu vuoi la stessa pagina, devi selezionare tutto il codice e poi fai un coppia-incolla in file manager --> crea nuova pagina --> e lo salvi con lo stesso nome -->
prova_form_mail.php
ora, perchè funzioni con il BBcode, hai bisogno di questi 2 file --> bbcode.php e bbcode2.php
fammi sapere...
:idea:
io avevo gia creato una pagina html con il titolo in alto e tutta la cornice esterna e ora volevo sapere come mettere questa cosa all'interno della cornice.
il sito dove la devo mettere è: http://elenabasile.altervista.org/index%203.html
grazie.
Ho inserito il form di contatto nel tuo codice. Guarda se così ti va bene, puoi comunque sempre modificarlo.
IMPORTANTE --> DEVI RINOMINARE LA PAGINA index 3.html --> in --> index 3.php
Codice PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title>Elena Basile</title>
<meta name="GENERATOR" content="OpenOffice.org 3.0 (Linux)">
<meta name="AUTHOR" content="Moreno Pasqualetto">
<meta name="CREATED" content="20090209;12161200">
<meta name="CHANGEDBY" content="Moreno Pasqualetto">
<meta name="CHANGED" content="20090209;12263500">
<style type="text/css"></style>
</head><body dir="ltr" lang="it-IT">
<table style="page-break-before: always; width: 992px; height: 69px; background-color: rgb(0, 204, 204);" border="1" cellpadding="4" cellspacing="3">
<col width="256*"> <tbody>
<tr>
<td style="width: 100%; vertical-align: top; height: 41px; background-color: rgb(0, 204, 204);">
<p style="background: rgb(204, 255, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center"><font style="font-size: 32pt;" size="7"><img style="width: 974px; height: 55px;" alt="" src="immagini/mami%201.png"><br>
</font></p>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center;">
<table style="text-align: left; width: 992px; height: 437px; background-color: rgb(51, 204, 255);" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; background-color: rgb(51, 204, 255); text-align: center;"><big><big><span style="font-style: italic;"><big style="text-decoration: underline;"><big><span style="font-style: italic;"><span style="font-weight: bold;"><span style="font-style: italic;"><span style="font-weight: bold;"><small><small><span style="font-style: italic;"><span style="font-weight: bold;"></span></span></small></small></span></span></span></span></big></big><br>
<span style="font-weight: bold;"><span style="text-decoration: underline;">
<span style="font-weight: bold;"></span></span></span></span>
<span style="font-weight: bold;"><span style="font-weight: bold;"></span></span>
<span style="font-weight: bold;"><span style="text-decoration: underline;"><span style="font-style: italic;"></span></span>
<span style="font-style: italic;"></span></span>
<span style="font-style: italic;"><span style="font-weight: bold;"><span style="text-decoration: underline;"></span></span>
<big><big><big><small>Per contattarmi utilizzare il seguente form di contatto:
<br>
<!--elenabasile2005@yahoo.it<br>-->
</small></big></big></big></span></big></big>
<?php
if (count($_POST))//invio email solo se $_POST è diverso da zero o è settato
{
//CONTROLLO HACKERS
foreach(array('nome','email','soggetto','messaggio') as $key) {$_POST[$key] = strip_tags($_POST[$key]);}
if(!is_secure($_POST)) {
$subject = "Hack Attempt via Contact Form!";
$body = " - Indirizzo IP: ".getenv("REMOTE_ADDR")."
- Agent: ".getenv("HTTP_USER_AGENT")."";
//QUI INSERISCI LA TUA EMAIL
$emailto = "eurosalute@altervista.org";
$headers = "From: $emailto";
//AVVERTI TE STESSO DELL'ATTACCO:
@mail($emailto, $subject, $body, $headers);
die("<br><br><font color=\"red\"><b>Asta la vista Hacker!</b></font><br><br>");
}
//end CONTROLLO HACKERS
$validate_form = true;
$filter_email = "/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/";
if (!preg_match($filter_email, $_POST[email])) {
echo ("<font color=\"red\"><b>Indirizzo Email non valido!</b></font><br>");
$validate_form = false;
}
if (empty($_POST[nome])) {
echo ("<font color=\"red\"><b>Non hai scritto alcun Nome!</b></font><br>");
$validate_form = false;
}
if (empty($_POST[soggetto])) {
echo ("<font color=\"red\"><b>Non hai scritto alcun Soggetto!</b></font><br>");
$validate_form = false;
}
if (empty($_POST[messaggio])) {
echo ("<font color=\"red\"><b>Non hai scritto alcun Messaggio!</b></font><br>");
$validate_form = false;
}
if ($validate_form)
{
//L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "elenabasile2005@yahoo.it";
//IL SOGGETTO DELLA MAIL
$subject = "Messaggio da $_POST[email]";
//CORPO DEL MESSAGGIO
//metti come commento il seguente $body:
//$body .= "\nMessaggio:\n__________\n" . @filter_var($_POST['note'], FILTER_SANITIZE_STRING);
//metti questo come $body:
$body = nl2br("\nSoggetto = ".stripslashes($_POST[soggetto])."\n\nMessaggio :\n".stripslashes($_POST[messaggio])."\n\nNome = ".stripslashes($_POST[nome])."\nDa = ".stripslashes($_POST[email])."\n");
//INTESTAZIONI SUPPLEMENTARI
$headers = "MIME-Version: 1.0\r\n" ;
$headers .= "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 7bit\r\n";
$headers .= "From: $_POST[email]\r\n";
//INVIO
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "<font color=\"blue\" size=\"5px\">E-mail inviata con successo!</font><br><br>";
//stampo il messaggio inviato:
echo "<font color=\"\">$body</font><br><br>";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi.<br><br>";
//echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
}
}//end if $validate_email
}//end if (count($_POST)
//# NON CAMBIARE NIENTE QUI SOTTO:
function is_secure($ar) {
$reg = "/(Content-Type|Bcc|MIME-Version|Content-Transfer-Encoding)/i";
if(!is_array($ar)) {return preg_match($reg,$ar);}
$incoming = array_values_recursive($ar);
foreach($incoming as $k=>$v) if(preg_match($reg,$v)) return false;
return true;
}
function array_values_recursive($array) {
$arrayValues = array();
foreach ($array as $key=>$value) {
if (is_scalar($value) || is_resource($value)) {
$arrayValues[] = $value;
$arrayValues[] = $key;
}
elseif (is_array($value)) {
$arrayValues[] = $key;
$arrayValues = array_merge($arrayValues, array_values_recursive($value));
}
}
return $arrayValues;
}
//end
?>
<br>
<form action="index 3.php" method="POST" name="form">
<table border="0">
<tr>
<td valign="top"><font size="2" color="">*Tuo Nome:</font></td>
<td>
<input size="40" name="nome" maxlength="60">
</td>
</tr>
<tr>
<td valign="top"><font size="2" color="">*Tuo Indirizzo email:</font></td>
<td>
<input size="40" name="email" maxlength="60">
</td>
</tr>
<tr>
<td valign="top"><font size="2" color="">*Soggetto del messaggio:</font></td>
<td>
<input size="40" name="soggetto" maxlength="60">
</td>
</tr>
<tr>
<td valign="top"><font size="2" color="">*Messaggio da inviare:</font></td>
<td>
<textarea rows="10" name="messaggio" cols="45"></textarea>
</td>
</tr>
<tr>
<td colspan="2" valign="bottom" align="center" height="30">
<!-- qui ho aggiunto name="send" per if ($_POST['send']) se utilizzato-->
<input type="submit" value="Invia" name="send">
<input type="reset" value="Cancella"></td>
</tr>
</table>
</form>
<big><big><span style="font-style: italic;"><big><big><big><br>
</big></big></big>
</span></big></big></td>
</tr>
</tbody>
</table>
</div>
<!-- Histats.com START (standard)-->
<script type="text/javascript">document.write(unescape("%3Cscript src=%27http://s10.histats.com/js15.js%27 type=%27text/javascript%27%3E%3C/script%3E"));</script>
<a href="http://www.histats.com" target="_blank" title="contatore visite free"><script type="text/javascript">
try {Histats.start(1,1102867,4,0,0,0,"00000000");
Histats.track_hits();} catch(err){};
</script></a>
<noscript><a href="http://www.histats.com" target="_blank"><img src="http://sstatic1.histats.com/0.gif?1102867&101" alt="contatore
visite free" border="0"></a></noscript>
<!-- Histats.com END -->
</body></html>
Nel mio sito, ho messo questo:
<A HREF="mailto:tua_USER @altervista.org?subject=Testo dell'oggetto">Scrivimi</a>
ho inserito il php nel mio sito per fare in modo che gli utenti possono inviarmi un messaggio sulla mia e-mail ma quando clicco su invia mi segna un errore.
il sito è questo: http://elenabasile.altervista.org/index%203.html
grazie.:roll:
è un errore di sintassi, dovresti qui specificare il codice php del file mail.php che stai usando per l'invio del messaggio, l'errore è il seguente:
Parse error: syntax error, unexpected T_STRING in /membri/elenabasile/mail.php on line 7
:roll:
il php è questo:
Codice PHP:
<?php
//L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "elenabasile2005@yahoo.it;
//IL SOGGETTO DELLA MAIL
$subject = "Aggiornamento files nell'area riservata - BSSP";
//CORPO DEL MESSAGGIO
$body .= "\nMessaggio:\n__________\n" . @filter_var($_POST['note'], FILTER_SANITIZE_STRING);
//INTESTAZIONI SUPPLEMENTARI
$headers = "From: nomeutente";
//INVIO
if(mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "E-mail inviata con successo!! Attendi qualche secondo e verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi. Ora verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url="/private/mediabssp.html\" />";
}
ci sono 2 errori di sintassi:
Codice PHP:
//qui manca la virgoletta:
$to = "elenabasile2005@yahoo.it;
//quindi è così:
$to = "elenabasile2005@yahoo.it";
Codice PHP:
//qui la virgoletta non ci vuole, poi manca uno slash:
echo "<meta http-equiv=\"refresh\" content=\"5;url="/private/mediabssp.html" />";
//quindi è così:
echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
grazie per la tua risposta. ho fatto come mi hai detto ma ora mi segna:
Parse error: syntax error, unexpected $end in /membri/elenabasile/mail.php on line 27
che cosa' è?
grazie.
sei sicura di aver postato tutto il codice del file?
guarda alla linea 27 cosa c'è?
:?:
non c'è una linea 27.
ma gli spazzi tra una riga e l'altra li devo contare?
ma linea 27 del file index o del file php.
l'errore è nel file mail.php --> Parse error: syntax error, unexpected $end in /membri/elenabasile/mail.php on line 27
probabilmente hai dimenticato di chiudere il codice php con ?>, esattamente:
dall' editor html del pannello di AV, puoi vedere i numeri delle linee corrispondenti ai comandi, istruzioni, ecc del codice php...Codice PHP:
<?php //inizio codice php
?> <!--fine codice php-->
devi contare anche gli spazi vuoti e anche i commenti
ho messo il ?> alla fine del file ma ora mi segna:
Parse error: syntax error, unexpected $end in /membri/elenabasile/mail.php on line 25
il file è questo:
Codice PHP:
<?php
//L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "elenabasile2005@yahoo.it";
//IL SOGGETTO DELLA MAIL
$subject = "Aggiornamento files nell'area riservata - BSSP";
//CORPO DEL MESSAGGIO
$body .= "\nMessaggio:\n__________\n" . @filter_var($_POST['note'], FILTER_SANITIZE_STRING);
//INTESTAZIONI SUPPLEMENTARI
$headers = "From: nomeutente";
//INVIO
if(mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "E-mail inviata con successo!! Attendi qualche secondo e verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi. Ora verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
?>
grazie.
prima della chiusura hai ommesso la parentesi graffa di chiusura del if else:
Codice PHP:
//INVIO
if(mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "E-mail inviata con successo!! Attendi qualche secondo e verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi. Ora verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=/private/mediabssp.html\" />";
} //qui è la parentesi graffa di chiusura del loop if else
?>
ora che ho messo la graffa alla fine non mi segna più nessun errore ma non invia il messaggio e mi lascia la pagina biancha.
http://elenabasile.altervista.org/index%203.html
grazie per le tue risposte.
ho fatto alcune prove ed a me funziona, prova a mandarti un messaggio da questa pagina:
http://eurosalute.altervista.org/tool/elenabasile.html
Ho usato i tuoi stessi codici, sia per l'html sia per il mail.php....
file elenabasile.html (corrispondente al tuo http://elenabasile.altervista.org/index%203.html ):
file mail.php:Codice HTML:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8">
<title>Elena Basile</title>
<meta name="GENERATOR" content="OpenOffice.org 3.0 (Linux)">
<meta name="AUTHOR" content="Moreno Pasqualetto">
<meta name="CREATED" content="20090209;12161200">
<meta name="CHANGEDBY" content="Moreno Pasqualetto">
<meta name="CHANGED" content="20090209;12263500">
<style type="text/css"></style>
<meta http-equiv="\"refresh\"" content="\"5;url=/private/mediabssp.html\"">
</head><body dir="ltr" lang="it-IT">
<table style="page-break-before: always; width: 992px; height: 69px; background-color: rgb(0, 204, 204);" border="1" cellpadding="4" cellspacing="3">
<col width="256*"> <tbody>
<tr>
<td style="width: 100%; vertical-align: top; height: 41px; background-color: rgb(0, 204, 204);">
<p style="background: rgb(204, 255, 255) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center"><font style="font-size: 32pt;" size="7"><img style="width: 974px; height: 55px;" alt="" src="immagini/mami%201.png"><br>
</font></p>
</td>
</tr>
</tbody>
</table>
<div style="text-align: center;">
<table style="text-align: left; width: 992px; height: 437px; background-color: rgb(51, 204, 255);" border="1" cellpadding="2" cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; background-color: rgb(51, 204, 255); text-align: center;">
<div style="text-align: right;"><big><big><span style="font-style: italic;"><big style="text-decoration: underline;"><big><span style="font-style: italic;"><span style="font-weight: bold;"><span style="font-style: italic;"><span style="font-weight: bold;"><small><small><span style="font-style: italic;"><span style="font-weight: bold;"></span></span></small></small></span></span></span></span></big></big><a href="index%201.html"><img style="border: 0px solid ; width: 69px; height: 39px;" alt="" src="immagini/INDIETRO.png"></a></span></big></big><br>
<big><big><span style="font-style: italic;"></span></big></big></div>
<form action="mail.php" method="post">
<big><big><big style="color: rgb(0, 0, 102);"><big>messaggio da
inviare</big></big><br>
</big></big>
<table style="width: 979px; height: 226px;" border="0">
<tbody>
<tr>
<td style="text-align: center;"><textarea rows="10" name="note" cols="40"></textarea></td>
</tr>
<tr align="center">
<td style="text-align: center;" colspan="2" height="30" valign="bottom"> <input value="Invia" type="submit"> <input value="Cancella" type="reset"></td>
</tr>
</tbody>
</table>
</form>
</td>
</tr>
</tbody>
</table>
</div>
<noscript><a href="http://www.histats.com" target="_blank"><img
src="http://sstatic1.histats.com/0.gif?1102867&101" alt="contatore
visite free" border="0"></a></noscript>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16425675-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body></html>
Codice PHP:
<?php
//L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "elenabasile2005@yahoo.it";
//IL SOGGETTO DELLA MAIL
$subject = "Nuovo Messaggio";
//CORPO DEL MESSAGGIO
$body .= "\nMessaggio:\n__________\n" . @filter_var($_POST['note'], FILTER_SANITIZE_STRING);
//INTESTAZIONI SUPPLEMENTARI
$headers = "From: elenabasile.altervista.org";
//INVIO
if(mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "E-mail inviata con successo!! Attendi qualche secondo e verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=http://elenabasile.altervista.org/index%203.html\" />";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi. Ora verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=http://elenabasile.altervista.org/index%203.html\" />";
}
?>
ho provato ed il messaggio è arrivato. ora provo a rifare il file php.
ho trovato dei messaggi in posta inviati da te alle 13:52 che erano finiti in antispam.
quei messaggi gli avevi inviati dal mio o dal tuo sito?
grazie.
ti ho inviato dei messaggi di test...testing....
guarda se ti sono arrivati nella mailbox....:?:
:shock:
si mi sono arrivati.
i messaggi li avevo inviati dal mio sito dalla pagina di prova:
http://eurosalute.altervista.org/tool/elenabasile.html
:!:
non capisco perche il tuo funziona ed il mio no anche se ho copiato quello che hai fatto.
sei sicura che il tuo file mail.php sia uguale a questo:
fai un semplice coppia-incolla....Codice PHP:
<?php
//L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "elenabasile2005@yahoo.it";
//IL SOGGETTO DELLA MAIL
$subject = "Nuovo Messaggio";
//CORPO DEL MESSAGGIO
$body .= "\nMessaggio:\n__________\n" . @filter_var($_POST['note'], FILTER_SANITIZE_STRING);
//INTESTAZIONI SUPPLEMENTARI
$headers = "From: elenabasile.altervista.org";
//INVIO
if(mail($to, $subject, $body, $headers)) { // SE L'INOLTRO È ANDATO A BUON FINE...
echo "E-mail inviata con successo!! Attendi qualche secondo e verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=http://elenabasile.altervista.org/index%203.html\" />";
} else {// ALTRIMENTI...
echo "Si sono verificati dei problemi nell'invio della mail, riprova pù tardi. Ora verrai reindirizzato alla pagina precedente...";
echo "<meta http-equiv=\"refresh\" content=\"5;url=http://elenabasile.altervista.org/index%203.html\" />";
}
?>
se dopo aver ripristinato il file mail.php, l'inoltro non funziona, prova ad attivare dal pannello di controllo AV il php5
:!:
non funziona ancora quindi provo ad attivare il controllo AV il php5.ù
grazie.
filter_var() necessita di php 5!.. è normale che non funzioni con PHP4!
Ciao!
accedi al pannello -->clicca su altersito --poi gestione file--> poi sulla rotellina che apre il file .htaccess
qui puoi editare il file .htaccess in modo semplificato:
alla voce :
Attiva supporto php5 (off = php4) metti ON
poi clicca su salva...
grazie a tutti per l'aiuto. ora funziona perfettamente.
Io ho bisogno della stessa, identica, cosa: uno script mail da inserire sul sito in modo che possano inviarmi mail.
Io ho creato un sito in HTML ma, a quanto pare, c'è bisogno di pagine in PHP...
Mi spiegate precisamente i passi da fare per ottenere lo stesso risultato?
Grazie!