BONJOUR

J'AI DEUX FICHIERS UN QUI FAIT LA REQUÊTE ET ENVOIE PAR URL LE NOM DU FICHIER, l'AUTRE DOIT FAIRE UN UNLINK POUR SUPPRIMER LE FICHIER ; JE SUIS UN PEU PERDU CELA NE FONCTIONNE PAS; Y A T'IL UNE PERSONNE PRÊTE A ME DÉPANNER. MERCI D'AVANCE
VOICI MON CODE CI DESSOUS
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
*******************
<?php echo $row_test['fichier']; ?>
<?php require_once('Connections/tgi.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
 
  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
 
  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}
 
$colname_test = "-1";
if (isset($_GET['fichier'])) {
  $colname_test = $_GET['fichier'];
  unlink( './wtgi/philippe/' . $row_test['fichier'] );
 
}
mysql_select_db($database_tgi, $tgi);
$query_test = sprintf("SELECT * FROM tgi_test WHERE fichier = %s", GetSQLValueString($colname_test, "text"));
$test = mysql_query($query_test, $tgi) or die(mysql_error());
$row_test = mysql_fetch_assoc($test);
$totalRows_test = mysql_num_rows($test);
 
mysql_free_result($test);
?>
**************************