"; print_r($_SESSION); echo ""; } function subscrive() { if( $_REQUEST['mail'] != '' ) { $log = substr($_REQUEST['mail'],0,20); $pas = substr($_REQUEST['mail'],-6); $log = ereg_replace ("[^a-z0-9]", "", $log); //id user pass mail service $query = " INSERT INTO mailing_users (user , pass , mail ) VALUES ('$log' , '$pas' , '{$_REQUEST['mail']}' ) "; mysql_query($query) or die("Désolé, ce mail est déja utilisé, choisissez en un autre."); $header="From: mailing@placeoweb.com Reply-To: contact@placeoweb.com MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit "; mail($_REQUEST['mail'],"Votre login/pass sur mailing.placeoweb","Envoyez votre mailing sur http://www.placeoweb.com/mailing/ Login : $log Password : $pas Votre mail : {$_REQUEST['mail']} ",$header); } } function extract_mails_from_string($string) { //$d_start = time(); set_time_limit(90); // Fixe le temps maximum d'exécution d'un script //echo "LA STRING POSSEDE ".strlen($string)." CHARATERES soit ".(strlen($string)/(1024*1024))." Mo\n"; // Substitutioon des chars non trouvés dans une adresse mail $search = array("'",'"', '<', '>','{','}','[',']','(',')','|','/','\\','#','*',':',';',',','?','!','=','&'); $replace = array(' ',' ', ' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' '); for($i=0;$i<33;$i++) { $search[] = chr($i); $replace[] = ' '; } //print_r($search); $string = str_replace($search, $replace, $string); $string = strtolower($string); if( substr($string,0,1) == ' ' ) $string = substr($string,1); if( substr($string,-1) == ' ' ) $string = substr($string,0,-1); $tab_mail = explode(' ', $string); $tab_mail = array_unique($tab_mail); /* set_time_limit(60); // Fixe le temps maximum d'exécution d'un script //$string = eregi_replace(",", " ", $string); //$string = eregi_replace("(<|>)", " ", $string); //$string = ereg_replace("(\r\n|\n|\r|\t)", " ",$string); $string = eregi_replace(" +", " ", $string); //enleve les multi espaces $string = eregi_replace("^[ ]+", "", $string); //enleve les espace au debut $string = eregi_replace("[ ]+$", "", $string); //enleve les espace a la fin $tab_mail = explode(" ", $string); $tab_mail = array_unique($tab_mail); */ $pattern = "^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,6}$"; foreach ($tab_mail as $key => $mail) { $tab_mail[$key] = str_replace(' ', '', $tab_mail[$key]); //$tab_mail[$key] = eregi_replace("[^[:alnum:]_\.-]+", " ", $tab_mail[$key]); //echo "
$key - {$tab_mail[$key]}\n"; /* if( $tab_mail[$key] == '' ) { unset($tab_mail[$key]); //echo " - DEL"; } */ if(!eregi($pattern, $mail)) { unset($tab_mail[$key]); //echo "
$key - $mail"; } } $tab_mail = array_unique($tab_mail); //$d_end = time(); //$d_run = $d_end - $d_start; //echo "DUREE DU PARSING : $d_run sec\n"; return $tab_mail; } function change_variables($tab_label,$str,$row) { /* echo "
";
	echo "LABELS : \n";
	print_r($tab_label);
	echo "STR : \n";	
	print_r($str);
	echo "ROW : \n";	
	print_r($row);	
	echo "
"; */ foreach( $tab_label as $champ_titre ) { $str = str_replace("{".$champ_titre."}",$row[$champ_titre],$str); //echo "str_replace(\"{\".$champ_titre.\"}\",$row[$champ_titre],str);
\n"; } return $str; } // Remplacer les URL par des liens cliquables + retours à la ligne function txt2html($in) { $in = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "\\0", $in); $in = nl2br($in); return $in; } ?>