Bonsoir, j'ai quelque difficulté à uploadé une image que j'ai modifié la taille dans le dossier. En faite, l'image est bien uploadé, mais pas modifié, elle a la même taille. Pouvez vous m'aider ?
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 <?php if(!empty($_POST['miniature']) && ($i == 0)) { $dossier = 'images/'; $source = str_replace(' ','',$dossier)."".$_FILES['chercher_avatar']['name']; $taillemax = round($_POST['miniature']); //round : On arrondi $img = getimagesize($source); $x=$img[0]; $y=$img[1]; if ($x > $y) { $y=$y*(($taillemax)/$x); $x=$taillemax; } if ($y > $x) { $x=$x*(($taillemax)/$y); $y=$taillemax; } if ($y == $x) { $x=$taillemax; $y=$taillemax; } echo "<img src=\"$source\" width=\"$x\" height=\"$y\" title=\"X = $x et Y = $x\"/>"; $avatar = time(); //Nom de l'image uploadé $avatar = "avatars/".str_replace(' ','',$avatar).".".$extension_upload; move_uploaded_file($_FILES['chercher_avatar']['tmp_name'],$avatar); } ?>
Merci, d'avance.![]()





Répondre avec citation





Partager