I'm sorry to ask question that has been seen a lot of time, but it seems to not work for me, so I have to ask you guys ... Thanks in advance !
here is my html form :
<form action="action/actionindex.php" method="post">
<label style="text-align:center;"><b>Changer d'image</b></label>
<input type="file" name="file" id="indeximage" style="margin-left:500px;"/>
<div class="bg" style="background-image:url('../image/papierpeint.jpg');width:95%;margin:0 auto;height:auto;">
<div class="welcometxt">
<ul>
<label><b>Titre de l'article (Saut de ligne : <img src="../image/sautligne.png"/>| Gras : <img src="../image/gras.png"/>| Italique : <img src="../image/italique.png"/>| Souligné : <img src="../image/souligne.png"/>)</b></label>
<textarea name="indexh2" rows="1" cols="80">
<?php getDesc(1) ?>
</textarea></br>
<label><b>Contenu l'article (Saut de ligne : <img src="../image/sautligne.png"/>| Gras : <img src="../image/gras.png"/>| Italique : <img src="../image/italique.png"/>| Souligné : <img src="../image/souligne.png"/>)</b></label>
<textarea name="indexp" rows="15" cols="110">
<?php getDesc(2)?>
</textarea>
<input type="submit" name="submit" value="Modifier"></br>
and here is actionindex.php :
if(isset($_POST['submit'])){
$name = $_FILES['file']['name'];
echo 'nom : '.$name;
$temp_name = $_FILES['file']['tmp_name'];
echo 'dossier temp : '.$temp_name;
if(isset($name)){
if(!empty($name)){
$location = '../../image/';
if(move_uploaded_file($temp_name, $location)){
echo 'File uploaded successfully';
}
}
} else {
echo 'You should select a file to upload !!';
}
}
Hope you guys help me, thanks !!