par
Invité » 03 déc. 2006, 18:32
Oui la destination etait un nom de site + les rep et sous rep, j'ai change, voila le code:
<?
include ("config.php");
if(isset($_POST['date'])) $date = $_POST['date'];
else $date = '';
if(isset($_POST['img'])) $img = $_POST['img'];
else $img = '';
$date = date("d/m/Y");
$img = $_FILES['img']['name'];
$FileSize = $_FILES['img']['size'];
$TempName = $_FILES['img']['tmp_name'];
$MaxFileSize = 100000;
$Destination = "/images/";
$Allow_Ext="(gif|jpg|jpeg)";
$temp=explode('.',$img);
$extension=($temp[count($temp)-1]);
$File_Ext = strstr($img, '.');
if(empty($img)){
echo "Pas de fichier a uploader<br/>";
}
elseif ($FileSize > $MaxFileSize){
echo "taille tres gde";
}
elseif (!eregi($Allow_Ext,$extension)){
echo "Extension non autorisé.<br/>";
}
elseif (file_exists($Destination.$img)) {
print "Le fichier $img existe<br/>";
}
else {
$move = move_uploaded_file($TempName, $Destination.$img);
if ($move)
{
print "Fichier <tt><b>".$img."</b></tt> envoyé.<br/>";
}
else
{
print "Fichier <tt><b>".$img."</b></tt> non envoyé.";
}
}
mysql_close ();
?>
et l'erreur:
Code : Tout sélectionner
Warning: file_exists() [function.file-exists]: Unable to access /images/btn_submit.gif in /mnt/122/sdb/f/b/issam.jaafari/tests/gallery/gallery_check.php on line 34
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to access /images/btn_submit.gif in /mnt/122/sdb/f/b/issam.jaafari/tests/gallery/gallery_check.php on line 39
Fichier btn_submit.gif non envoy
Oui la destination etait un nom de site + les rep et sous rep, j'ai change, voila le code:
[php]
<?
include ("config.php");
if(isset($_POST['date'])) $date = $_POST['date'];
else $date = '';
if(isset($_POST['img'])) $img = $_POST['img'];
else $img = '';
$date = date("d/m/Y");
$img = $_FILES['img']['name'];
$FileSize = $_FILES['img']['size'];
$TempName = $_FILES['img']['tmp_name'];
$MaxFileSize = 100000;
$Destination = "/images/";
$Allow_Ext="(gif|jpg|jpeg)";
$temp=explode('.',$img);
$extension=($temp[count($temp)-1]);
$File_Ext = strstr($img, '.');
if(empty($img)){
echo "Pas de fichier a uploader<br/>";
}
elseif ($FileSize > $MaxFileSize){
echo "taille tres gde";
}
elseif (!eregi($Allow_Ext,$extension)){
echo "Extension non autorisé.<br/>";
}
elseif (file_exists($Destination.$img)) {
print "Le fichier $img existe<br/>";
}
else {
$move = move_uploaded_file($TempName, $Destination.$img);
if ($move)
{
print "Fichier <tt><b>".$img."</b></tt> envoyé.<br/>";
}
else
{
print "Fichier <tt><b>".$img."</b></tt> non envoyé.";
}
}
mysql_close ();
?>
[/php]
et l'erreur:
[code]
Warning: file_exists() [function.file-exists]: Unable to access /images/btn_submit.gif in /mnt/122/sdb/f/b/issam.jaafari/tests/gallery/gallery_check.php on line 34
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to access /images/btn_submit.gif in /mnt/122/sdb/f/b/issam.jaafari/tests/gallery/gallery_check.php on line 39
Fichier btn_submit.gif non envoy
[/code]