View Single Post

  #66 (permalink)  
Old 03-06-08, 16:25
tem's Avatar
tem tem is offline
Moderator
 
Join Date: Jan 1970
Posts: 493
Rep Power: 40
tem is on a distinguished road
Re: Email form con Flash CS3 e PHP

Ciao!

se adesso i caratteri arrivano bene in tutti i casi col tuo form abbiamo concluso.

il fatto che certe non vengono recapitate può essere dato dal fatto che ne stai inviando parecchie e i sistemi delle webMail come quelli di aruba le vedono come potenziali spam..

conta che stai inviando mail da php.. quindi è possibile che se "martelli" un indirizzo questo ti prenda per uno script che sta inviando mail a ripetizione.

se ti va possiamo fare delle prove con i caratteri accentati da linux a server windows visto che abbiamo scoperto che si perdono.. così diamo poi a flep il nuovo file inviaMail.php win version + linux version

intanto posto il codice php corretto di inviaMail.php (hosting windows) in modo che sia reperibile a chi ne avesse bisogno:
HTML Code:
<?Php
	$email = $_POST['email'];
	$to = "mionome@dominio.it";
	$nome= $_POST['nome'];
	$subject = ($_POST['titolo']);
	$message = ($_POST['messaggio']);
	
	function meftexte($texte){ 
		$texte = urldecode($texte);
		$texte = htmlentities($texte);
		$texte = trim($texte); 
		$texte = stripslashes($texte);
		$texte = nl2br($texte);
		$texte = str_replace(">", ">", $texte); 
		$texte = str_replace("<", "<", $texte); 
		$texte = strip_tags($texte, '[b][i]'); 
		return $texte; 
	}
	
	$message = meftexte($message);
	$subject = meftexte($subject);
	
	$message .= "\n\n---------------------------\n";
	$message .= "E-mail inviata da:" . $nome . " <" . $email . ">\n";
	
	$header = "To: $to\n";
	$header .= "From: $email\n";
	$header .= "MIME-Version: 1.0\n";
	$header .= "Content-Type: text/html; charset=UTF-8\n";
	$header .= "X-Mailer: PHP/" . phpversion() . "\n";
	
	if(@mail($to, $subject, $message, $header))
	{
		echo "answer=ok";
	} 
	else 
	{
		echo "answer=error";
	}
?>
ricordarsi di implementare lato flash queste righe:
Code:
var variables:URLVariables=new URLVariables();
variables.email=email_txt.text;
variables.messaggio=escape(message_txt.text);
variables.titolo=escape(title_txt.text);
variables.nome=name_txt.text;
__________________
http://www.thetconcept.com
Reply With Quote