Bonjour,

j'ai sur un site une table annonce qu est remplie avec tous les champs sauf le champ photo qui fait l'objet d'une mise a jour dans un espace membre au moment de l'upload tout marche bien sauf la mise à jour du nom de la photo dans la table qui est update par ca pour tout
/var/tmp/phpBTeVAw

je ne vois pas à quoi cela correspond
si vous avez une idee car j'aimerais que le nom de la photo envoyee par le champs fichier photo soit update dans ma base voivi mon code
Code : 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php 
session_start(); 
include ("gsm.php"); 
session_start(); 
if (!$_SESSION["idmembre"]) { 
header ("location: loggout.php"); 
die(); 
} 
//   --------------------------------------------- 
//   Pure PHP Upload version 1.1 
//   ------------------------------------------- 
if (phpversion() > "4.0.6") { 
   $HTTP_POST_FILES = &$_FILES; 
} 
define("MAX_SIZE",100000); 
define("DESTINATION_FOLDER", "./foto"); 
define("no_error", "/sectionmembre.php"); 
define("yes_error", "/uploadphoto.php"); 
$_accepted_extensions_ = "gif,jpg,jpeg"; 
if(strlen($_accepted_extensions_) > 0){ 
   $_accepted_extensions_ = @explode(",",$_accepted_extensions_); 
} else { 
   $_accepted_extensions_ = array(); 
} 
/*   modify */ 
if(!empty($HTTP_POST_FILES['photo'])){ 
   if(is_uploaded_file($HTTP_POST_FILES['photo']['tmp_name']) && $HTTP_POST_FILES['photo']['error'] == 0){ 
      $_file_ = $HTTP_POST_FILES['photo']; 
      $errStr = ""; 
      $_name_ = $_file_['name']; 
      $_type_ = $_file_['type']; 
      $_tmp_name_ = $_file_['tmp_name']; 
      $_size_ = $_file_['size']; 
      if($_size_ > MAX_SIZE && MAX_SIZE > 0){ 
         $errStr = "File troppo pesante"; 
      } 
      $_ext_ = explode(".", $_name_); 
      $_ext_ = strtolower($_ext_[count($_ext_)-1]); 
      if(!in_array($_ext_, $_accepted_extensions_) && count($_accepted_extensions_) > 0){ 
         $errStr = "Estensione non valida"; 
      } 
      if(!is_dir(DESTINATION_FOLDER) && is_writeable(DESTINATION_FOLDER)){ 
         $errStr = "Cartella di destinazione non valida"; 
      } 
      $sql="update annonce set photo='$photo' where idannonce='$idannonce'"; 
      $res=mysql_query($sql) or die (mysql_error()); 
      if(empty($errStr)){ 
         if(@copy($_tmp_name_,DESTINATION_FOLDER . "/" . $_name_)){ 
            header("Location: " . no_error); 
         } else { 
            header("Location: " . yes_error); 
         } 
      } else { 
         header("Location: " . yes_error); 
      } 
   } 
} 
 
 
?> 
 
Revenir en haut