voici le code
[php]
<form action= "prechargement.php" method="post" enctype="multipart/form-data">
<fieldset style="width:600px">
<legend><b><h6>Précharger white liste</h6></b></legend>
<table width="80%" class="centre_tab2">
<tr><td align="right"><label for="services">Liste des services:</label></td>
<td><select name="SdsERgfgfg" id="services">
<option value="club20">CLUthj0</option>
<option value="yabusiness">YlmlmjhESS</option>
<option value="internetmobil">cddd</option>
<option value="familleami">FAjkgkhkjMILLE AhjkMIS</option>
<option value="nexs">jkghkjk</option>
<option value="pharmacies">PHfkjkARMghkgkACIfkES</option>
</select></td></tr>
<tr><td align="right">Nom du Fichier</td>
<td><input type="file" name="fichier" size="40" id="fichier" /></td>
<td><input name="submit" type="submit" value="Charger" /></td></tr>
</table>
</fieldset>
</form>
<?php
ini_set('display_errors','1');
//Inclusion de la classe mère
include ("SGBD.class.php");
/* Initialisation de la variable du SGBD correspondant */
$SQL = "MySQL";
// Inclusion de la classe fille du SGBD correspondant
include ($SQL.".SGBD.class.php");
/* Création d'un nouvel objet de la classe fille + lancement du constructeur */
$database = new $SQL('root', '', 'localhost', 'dbprojet');
// Connection à la base de données
$database->connect();
if( isset($_FILES['fichier']))
{
$nom=$_FILES['fichier']['name'];
$extensions_valides= array('xlsx' , 'txt' , 'xls','csv' );
$extension_upload = strtolower( substr( strrchr($_FILES['fichier']['name'], '.') ,1) );
if( in_array( $extension_upload, $extensions_valides ))
{
echo 'extension valide';
$ser = $_POST['SERVICES'];
echo "$ser";
echo "$nom";
$open=fopen($nom,'r');
while (!feof($open))
{
$get=fgets($open,4096);
$slashed=addslashes($get);
$str=trim($slashed);
$ligne=explode ("\n",$str);
$numero=$ligne[0];
$database->requete("INSERT WHITE_LISTE VALUES('','$numero','$ser')");
}
fclose($open);
print '<h5 color="red">Importation terminée</h5>';
}else
{
echo 'extension non valide';
}
}
?>
[/php]