$rep=opendir("images/");
while ($nom=readdir($rep))
{
if (!ereg("^.", $nom)
<?
&n bsp;
if ($_POST)
{
if ($_POST["envoyer"])
{
if (is_uploaded_file($_FILES["fichier"]["tmp_name"]))
{
echo "Le fichier ".$_FILES["fichier"]["name"]." a bien été téléchargé.<br />";
echo "Il fait ".$_FILES["fichier"]["size"]." et est de type ".$_FILES["fichier"]["type"]."<br />";
if (move_uploaded_file($_FILES["fichier"]["tmp_name"],"./images/affiches/telechargement/".$_FILES["fichier"]["name"]))
{
$rep=opendir("images/affiches/telechargement/");
$nom=readdir($rep)
$nom2="images/affiches/telechargement/".$nom;
$source = imagecreatefromjpeg($nom2); // La photo est la source
$x=imagesx($handle);
$y=imagesy($handle);
$k=$x/100;
$y_dest=$y/$k;
$destination = imagecreatetruecolor(160,$y_dest); // On crée la miniature vide
$largeur_source = imagesx($source);
$hauteur_source = imagesy($source);
$largeur_destination = imagesx($destination);
$hauteur_destination = imagesy($destination);
// On crée la miniature
imagecopyresampled($destination, $source, 0, 0, 0, 0, $largeur_destination, $hauteur_destination, $largeur_source, $hauteur_source);
imagejpeg($destination, 'images/affiches/pharmapetit.jpg');
imagedestroy($source);
imagedestroy($destination);
==> j'en suis ici pour le moment
&n bsp; &nbs p;
//fin du script doublement et redimen tionnement
print "Ok, l'affiche est bien remplacée !";
}
}
else
{
echo "Le fichier ".$_FILES["fichier"]["name"]." n'a pas été téléchargé<br />".
"Peut-être dépassait-il la limite des 1Mo<br />".< br /> "A moins que tu n\'ais essayé de truander"; }
}
}
else
{
echo '<p align="center"><font color="#0D0836">L'image ne doit pas faire plus de 1Mo</p></font>';
?>
  ; <center>
<p style="text-indent: 45px; line-height: 150%; margin: 0 6px; text-align:center">
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
<font style="color: #000035">Télécharger l'image.
<input name="fichier" type="file">
<input name="envoyer" type="submit" value="Envoyer">
</font>
</form>
</center>
</p>
<? if ($_POST)
{
if ($_POST["envoyer"])
{
if (is_uploaded_file($_FILES["fichier"]["tmp_name"]))
{
echo "Le fichier ".$_FILES["fichier"]["name"]." a bien été téléchargé.<br />";
echo "Il fait ".$_FILES["fichier"]["size"]." et est de type ".$_FILES["fichier"]["type"]."<br />";
if (move_uploaded_file($_FILES["fichier"]["tmp_name"],"./i mages/affiches/telechargement/".$_FILES["fichier"]["name"]))
{
$nom='FILES["fichier"]["name"]'; $nom2="images/affiches/telechargement/".$nom;
$handle=imagecreatefromjpeg($nom2); // La photo est la source
$x=imagesx($handle);
$y=imagesy($handle);
$k=$x/160; //attention
$y_dest=$y/$k;
$destination = imagecreatetruecolor(160,$y_dest); // On crée la miniature vide
// On crée la miniature
imagecopyresampled($destination, $handle, 0, 0, 0, 0, 160, $y_dest, $x, $y);
imagejpeg($destination, 'images/affiches/pharmapetit'.$nom.'.jpg'); //sinon tu ecrasera l'image precedente
imagedestroy($handle);
imagedestroy($destination);
&n bsp; &nbs p;
//fin du script doublement et redimentionnement
print "Ok, l'affiche est bien remplacée !";
}
}
else
{
echo "Le fichier ".$_FILES["fichier"]["name"]." n'a pas été téléchargé<br />".
"Peut-être dépassait-il la limite des 1Mo<br />".
"A moins que tu n'ais essayé de truander";
}
}
}
else
{
echo '<p align="center"><font style="color: #0D0836">L\'image ne doit pas faire plus de 1Mo</p></font>';
?>
<center>
<p style="text-indent: 45px; line-height: 150%; margin: 0 6px; text-align:center">
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
<font style="color: #000035">Télécharger l'image.
<input name="fichier" type="file">
<input name="envoyer" type="submit" value="Envoyer">
</font>
</form>
</center>
//print '<img src=TES IMAGES>
</p>
<table cellpadding="0" cellspacing="0" width="634" height="163">
<!-- MSCellFormattingTableID="6" -->
<tr>
<td colspan="3" height="2">
<img alt="" width="1" height="2" src="images/MsSpacer.gif"></td>
</tr>
<tr>
<td width="4">
<img alt="" width="4" height="1" src="images/MsSpacer.gif"></td>
<td width="626">
<table cellpadding="0" cellspacing="0" border="0" width="626" height="157" >
<tr>
<td valign="top" height="157" width= "626">
<!-- MSCellFormattingType="content" --> ;
<table border="0" cellpadding="2" wi dth="626" height="30" id="table8" cellspacing="0" style="margin:0; border-left-width: 0px; border-right-width: 0px; word-spacing:0; text-indent:0;&nbs p;line-height:100%; text-align:justify; vertical-align:middle">
<tr>
<td width="626" height="30" style="border-style: solid; border-width: 1px" borderstyle="color: #000035" background="images/grandgris.jpg">
<p& nbsp;align="center"><b><i>
<fo nt face="Tahoma" size="4" style="color: #0D0836">
Upload image</font></i></b></td>
</tr>
<tr>
<td height="30" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0; border-bottom: 1px solid #C0C0C0">
<p& nbsp;align="center"><font style="color: #0D0836">
<?
if ($_POST)
{
if ($_POST["envoyer"])
{
if (is_uploaded_file($_FILES["fichier"]["tmp_name"]))
{
echo "Le fichier ".$_FILES["fichier"]["name"]." a bien été téléchargé.<br />";
echo "Il fait ".$_FILES["fichier"]["size"]." et est de type ".$_FILES["fichier"]["type"]."<br />";
if (move_uploaded_file($_FILES["fichier"]["tmp_name"],"./i mages/affiches/telechargement/".$_FILES["fichier"]["name"]))
{
$nom='FILES["fichier"]["name"]';
$nom2="images/affiches/telechargement/".$nom;
$handle=imagecreatefromjpeg($nom2); // La photo est la source
$x=imagesx($handle);
$y=imagesy($handle);
$k=$x/160; //attention
$y_dest=$y/$k;
$destination = imagecreatetruecolor(160,$y_dest); // On crée la miniature vide
// On crée la miniature
imagecopyresampled($destination, $handle, 0, 0, 0, 0, 160, $y_dest, $x, $y);
imagejpeg($destination, 'images/affiches/pharmapetit.jpg');
imagedestroy($handle);
imagedestroy($destination);
&n bsp; &nbs p;
//fin du script doublement et redimentionnement
print "Ok, l'affiche est bien remplacée !";
}
}
else
{
echo "Le fichier ".$_FILES["fichier"]["name"]." n'a pas été téléchargé<br />".
"Peut-être dépassait-il la limite des 1Mo<br />".
"A moins que tu n'ais essayé de truander";
}
}
}
else
{
echo '<p align="center"><font style="color: #0D0836">L\'image ne doit pas faire plus de 1Mo</p></font>';
?>
  ; <center>
<p style="text-indent: 45px; line-height: 150%; margin: 0 6px; text-align:center">
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
<font style="color: #000035">Télécharger l'image.
<input name="fichier" type="file">
<input name="envoyer" type="submit" value="Envoyer">
</font>
</form>
</center>
</p>
</p >
<p& gt; </td>
</tr>
<tr>
<td height="30"> </td>
</tr>
<tr>
<td height="30"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td height="157" width="4">
<img alt="" width="4" height="1" src="images/MsSpacer.gif"></td>
</tr>
<tr>
<td colspan="3" height="4">
<img alt="" width="1" height="4" src="images/MsSpacer.gif"></td>
</tr>
</table>
<center>
<p style="text-indent: 45px; line-height: 150%; margin: 0 6px; text-align:center">
<form enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
<font style="color: #000035">Télécharger l image.
<input name="fichier" type="file">
<input name="envoyer" type="submit" value="Envoyer">
</font>
</form>
</center>
</p>
</p >
<p& gt; </td>
</tr>
<tr>
<td height="30"> </td>
</tr>
<tr>
<td height="30"> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td height="157" width="4">
<img alt="" width="4" height="1" src="images/MsSpacer.gif"></td>
</tr>
<tr>
<td colspan="3" height="4">
<img alt="" width="1" height="4" src="images/MsSpacer.gif"></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="634" height="163">
<!-- MSCellFormattingTableID="6" -->
<tr>
<td colspan="3" height="2">
<img alt="" width="1" height="2" src="images/MsSpacer.gif"></td>
</tr>
<tr>
<td width="4">
<img alt="" width="4" height="1" src="images/MsSpacer.gif"></td>
<td width="626">
<table cellpadding="0" cellspacing="0" border="0" width="626" height="157" >
<tr>
<td valign="top" height="157" width= "626">
<!-- MSCellFormattingType="content" --> ;
<table border="0" cellpadding="2" wi dth="626" height="30" id="table8" cellspacing="0" style="margin:0; border-left-width: 0px; border-right-width: 0px; word-spacing:0; text-indent:0;&nbs p;line-height:100%; text-align:justify; vertical-align:middle">
<tr>
<td width="626" height="30" style="border-style: solid; border-width: 1px" borderstyle="color: #000035" background="images/grandgris.jpg">
<p& nbsp;align="center"><b><i>
<fo nt face="Tahoma" size="4" style="color: #0D0836">
Upload image</font></i></b></td>
</tr>
<tr>
<td height="30" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0; border-bottom: 1px solid #C0C0C0">
<p& nbsp;align="center">
<?
if ($_POST)
{
if ($_POST["envoyer"])
{
if (is_uploaded_file($_FILES["fichier"]["tmp_name"]))
{
echo "Le fichier ".$_FILES["fichier"]["name"]." a bien été téléchargé.<br />";
echo "Il fait ".$_FILES["fichier"]["size"]." et est de type ".$_FILES["fichier"]["type"]."<br />";
if (move_uploaded_file($_FILES["fichier"]["tmp_name"],"./images/affiches/telechargement/".$_FILES["fichier"]["name"]))
{
$rep=opendir("images/affiches/telechargement/");
while ($nom=readdir($rep))
{
&n bsp;$nom2<