voilà mon problème j'ai réalisé un formulaire pour uploder des images gif ou jpg sa marche tres bien mais pour une vidéo au format wvm il rempli biens la base avec le nom du fichier mais ne copie pas le fichier dans le dossier de destination.
le même formulaire avec les même commande pour les images marche très bien
si quelqu'un pouvait m'aider encore mille fois merci
ci joint le code ma page :
<?php
include ('../includes/config.php');
include ('../includes/style.php');
include ('../includes/functions.php');
$base = mysql_connect(MYSQL_SERVEUR, MYSQL_LOGIN, MYSQL_PASSWORD);
mysql_select_db(MYSQL_BASE, $base);
if($video != "none")
{
if(file_exists("$video_name"))
{
}
else
{
copy($video,"video_2005/$video_name");
}
}
if (isset($_GET['id']) && !isset($_GET['go'])) {
$news=creer_bbcode($news);
$video=creer_bbcode($video);
$comm_concours=creer_bbcode($comm_concours);
$sql = 'SELECT video FROM cec_2005 WHERE id="'.$_GET['id'].'"';
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$nombre = mysql_num_rows($req);
if ($nombre == 1) {
$data = mysql_fetch_array($req);
$_POST['video'] = $data['video'];
$sql = 'SELECT video FROM cec_2005 WHERE id="'.$_GET['id'].'"';
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$data6 = mysql_fetch_array($req);
$video=$data6['video'];
$video=str_replace($video,'<embed src="./video_2005/'.$video.'" showcontrols="0" showtracker="0" showdisplay="0" showstatusbar="0" type="application/x-mplayer2" autostart="1">',$video);
}
else {
//header('Location: index.php');
//exit('<span class="texte_titre">Modification correct -</span><br><a class="lien_danews" href="index.php">Retour accueil administration </a> ');
}
}
if (isset($_GET['go']) && $_GET['go'] == 'ok') {
//if (!empty($_POST['auteur']) && !empty($_POST['titre']) && !empty($_POST['news'])) {
//$sql = 'UPDATE cec_2005 SET date="'.$_POST['date'].'", pays="'.$_POST['pays'].'", abreg="'.$_POST['abreg'].'", titre="'.$_POST['titre'].'", traduc="'.$_POST['traduc'].'", auteur="'.$_POST['auteur'].'" , compos="'.$_POST['compos'].'", interpre="'.$_POST['interpre'].'", num_qualife="'.$_POST['num_qualife'].'", num_finale="'.$_POST['num_finale'].'", pts_qualife="'.$_POST['pts_qualife'].'", class_qualife="'.$_POST['class_qualife'].'", pts_finale="'.$_POST['pts_finale'].'", class_finale="'.$_POST['num_finale'].'", comm_selection="'.$_POST['comm_selection'].'", comm_concours="'.$_POST['comm_concours'].'", texte_original="'.$_POST['texte_original'].'", texte_francais="'.$_POST['texte_francais'].'", lien_pays="'.$_POST['lien_pays'].'", lien_artiste="'.$_POST['lien_artiste'].'", lien_local="'.$_POST['lien_local'].'", lien_selection="'.$_POST['lien_selection'].'" WHERE id="'.$_POST['id'].'"';
//mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
$sql = 'UPDATE cec_2005 SET video="'.$video_name.'" WHERE id="'.$_POST['id'].'"';
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br>'.mysql_error());
//header('Location:.index.php');
exit('<div id="Layer1" style="position:absolute; left:250px; top:180px; width:387px; height:166px; z-index:1"><div align="center"><img src="../images/50eme.gif" width="160" height="166" border="0"><hr width="380" size="1" noshade><span class="texte_titre">- Enregistrement Correct -</span><hr width="380" size="1" noshade><br><br><a class="lien_danews" a href="javascript:window.close()"<img src="../images/fermer.gif" alt="Fermer" width="13" height="13" align="absmiddle"> Fermer la fenêtre</a></div></div>');
}
// else {
// $message = 'Votre adresse Email a un format non valide.';
//}
//}
//else {
//$message = 'Au moins un des champs obligatoires est vide.';
//}
?>
<body bgproperties=fixed>
<div id="haut" style="position:absolute; left:10px; top:15px; width:770px; height:20px; z-index:2; visibility: visible;">
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="750" height="230">
<div align="left"></div></td>
</tr>
<tr>
<td><form name="formulaire" ENCTYPE="multipart/form-data" method="post" action="edit_video.php?go=ok">
<table width="740" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF"style="BORDER-TOP: #800000 1px solid; BORDER-RIGHT: #CFBCA6 1px solid; BORDER-BOTTOM: #CFBCA6 1px solid; BORDER-LEFT: #800000 1px solid">
<tr bgcolor="#FFFFFF">
<td width="100" height="20" align="left" valign="middle">
<div align="right"><span class="texte_normal">Nom
fichier :</span></div></td>
<td class="texte_titre" width="790" height="20" align="left" valign="middle">
<div align="left"><?php if (!isset($_POST['video'])) $_POST['video'] = ''; echo stripslashes($_POST['video']); ?></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" align="left" valign="middle">
<div align="right"><span class="texte_normal">Vidéo :</span></div></td>
<td class="texte" width="790" align="center">
<div align="left"> <?php echo '<span class="texte_normal">'.$video.'</span>';?>
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" height="50" align="left" valign="middle">
<div align="right"></div></td>
<td width="790" height="50" align="center" class="texte">
<div align="left">
<input type='hidden' ENCTYPE="multipart/form-data" name='video' value='20000000'>
<input type="file" name="video" size="20">
<br>
<br>
<i>(Format vidéo : wmv)</i></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" align="center"> </td>
<td width="790" align="center">
<div align="left"></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" height="20" align="center"> </td>
<td width="790" height="20" align="center">
<div align="left">
<input name="submit2" type="submit" value="Modifier">
</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="100" align="center">
<div align="left"> </div></td>
<td width="790" align="center">
<div align="left"></div></td>
</tr>
<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>">
</table>
</form>
<div align="left"></div></td>
</tr>
<tr>
<td width="750" valign="middle"> <div align="center">
<?php include ('../includes/copyright.php');?>
</div></td>
</tr>
</table>
</body>
</head>
</html>