par
nom d'utilisateur » 06 avr. 2008, 19:13
apres quelques recherches j'ai trouvé un truc plus costaud :
$AUTH_EXT = array( ".jpeg");
function isExtAuthorized($ext){
global $AUTH_EXT;
if(in_array($ext, $AUTH_EXT)){
return true;
}else{
return false;
}
}
$extension1 = strrchr($_FILES['photo1']['name'], ".") ;
//$extension2 = strrchr($_FILES['photo2']['name'], ".") ;
//$extension3 = strrchr($_FILES['photo3']['name'], ".") ;
if(!isExtAuthorized($extension1)){$erreur = "Format de photo incorrect.";}
ca a l'air d'etre bon, par contre contrairement a l'autre j'arrive pas a tester plusieurs photos en meme temps (j'ai 3 champs fichier) , comment ecrire le truc pour tester les 3 Merciiiiii
apres quelques recherches j'ai trouvé un truc plus costaud :
[php]
$AUTH_EXT = array( ".jpeg");
function isExtAuthorized($ext){
global $AUTH_EXT;
if(in_array($ext, $AUTH_EXT)){
return true;
}else{
return false;
}
}
$extension1 = strrchr($_FILES['photo1']['name'], ".") ;
//$extension2 = strrchr($_FILES['photo2']['name'], ".") ;
//$extension3 = strrchr($_FILES['photo3']['name'], ".") ;
if(!isExtAuthorized($extension1)){$erreur = "Format de photo incorrect.";}
[/php]
ca a l'air d'etre bon, par contre contrairement a l'autre j'arrive pas a tester plusieurs photos en meme temps (j'ai 3 champs fichier) , comment ecrire le truc pour tester les 3 Merciiiiii