window.location="http://www.e-mailing-tunisie.com/";'); ///$cnt = array("host"=>"localhost", "user"=>"root", "pass"=>"vertrigo", "db"=>"mailing"); $cnt = array("host"=>"localhost", "user"=>"emailtnusr", "pass"=>"Df=5z02+", "db"=>"emailtndb"); mysql_connect($cnt["host"], $cnt["user"], $cnt["pass"]) or die(mysql_error()); mysql_select_db($cnt["db"]); define("PASSWORD", "azerty"); define("LOGIN", "openup"); ?>'.$joursem[date("w",$timestamp)].' '.$jour.' '.$moi[$mois-1].' '.$annee.' a '.$hl[0].'h'.$hl[1]; return $ndt; } /// fonction date format date function affdate2($date){ $joursem = array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'); $moi=array('Janvier.','Fevrier.','Mars','Avril.','Mai','Juin','Juillet.','Aout','Septembre.','Octobre.','Novombre.','Decembre.'); list($j, $h)= split(" ", $date, 2); list($annee, $mois, $jour) = explode('-', $j); $hl=explode(":",$h); $timestamp = mktime (0, 0, 0, $mois, $jour, $annee); $ndt=$joursem[date("w",$timestamp)].' '.$jour.' '.$moi[$mois-1].' '.$annee.' à '.$hl[0].'h'.$hl[1]; return $ndt; } function affdate_sans_heure($date){ $joursem = array('Dimanche', 'Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi'); $moi=array('Janvier.','Fevrier.','Mars','Avril.','Mai','Juin','Juillet.','Aout','Septembre.','Octobre.','Novembre.','Decembre.'); list($j, $h)= split(" ", $date, 2); list($annee, $mois, $jour) = explode('-', $j); $timestamp = mktime (0, 0, 0, $mois, $jour, $annee); $ndt=$joursem[date("w",$timestamp)].' '.$jour.' '.$moi[$mois-1].' '.$annee; return $ndt; } /// fonction split texte function edittext($string, $nbstring){ $msg=""; $nstring2=$nbstring-3; $ltt=strlen(str_replace(" ","",$string)); if($ltt>$nbstring) { for($i=0;$i<=$nbstring2;$i++) $msg.=$string[$i]; for($i=$nbstring2;$i0) { return array_unique($aEmails[0]); } } return null; } ///verification adresse email function VerifierAdresseMail($adresse) { if($adresse) { $Syntaxe='#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#'; if(preg_match($Syntaxe,$adresse)) return true; else return false; } else return true; } /////verification login function vsyntax($text) { if (ereg('[^A-Za-z0-9]', $text)) return false; else return true; } /// verification nom function vsyntaxnom($text) { if (ereg('[^A-Za-z ]', $text)) return false; else return true; } //// correction lien function correct_lien($lien){ $cc=0; for($c=0;$c<= strlen($lien); $c++) { if($lien[$c]==".") $cc++; } $strlien=$lien[0].$lien[1].$lien[2].$lien[3]; if($strlien!=="http" && $strlien=="www.") $liensrc="http://".$lien; elseif($strlien!=="www." && $strlien!=="http" && $cc>0) $liensrc="http://www.".$lien; else { if($strlien!=="www." && $strlien=="http") { if($lien[7].$lien[8].$lien[9].$lien[10]=="www.") $s=11; else $s=7; $liensrc="http://www."; for($i=$s;$i<= strlen($lien); $i++) $liensrc.=$lien[$i]; } elseif($cc>0) $liensrc=$lien; else $liensrc="http://www.".$lien.".com" ; } return $liensrc; } //// verification nom pays function verifiecararcteres($str){ $str=str_replace("é","é",$str); $str=str_replace("Ã?","e",$str); $str=str_replace("è","ee",$str); $str=str_replace("ï","ï",$str); $str=str_replace("ç","ç",$str); $str=str_replace("ô","o",$str); $str=str_replace("ê","e",$str); $str=strtr($str, "ÀÁÂÃÄÅàáâãäåÒÓÔÕÖØòóôõöøÈÉÊËèéêëÇçÌÍÎÏìíîïÙÚÛÜùúûüÿÑñ", "aaaaaaaaaaaaooooooooooooeeeeeeeecciiiiiiiiuuuuuuuuynn"); return utf8_encode(ucfirst($premier)); } ////generation codes aleatoire function generer_code($l){ $char="0123456789ABCDEF"; for($i=0;$i<$l; $i++) $code.=$char[rand(0, strlen($char))]; return $code; } function realip() { if (isSet($_SERVER)) { if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"])) { $realip = $_SERVER["HTTP_X_FORWARDED_FOR"]; } elseif (isSet($_SERVER["HTTP_CLIENT_IP"])) { $realip = $_SERVER["HTTP_CLIENT_IP"]; } else { $realip = $_SERVER["REMOTE_ADDR"]; } } else { if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) { $realip = getenv( 'HTTP_X_FORWARDED_FOR' ); } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) { $realip = getenv( 'HTTP_CLIENT_IP' ); } else { $realip = getenv( 'REMOTE_ADDR' ); } } return $realip; } function age($datenai){ $tday=date("Y"); $dn=explode("-",$datenai); $age =$tday - $dn[0]; return $age; } ?>