hello i have a form with many input ( name, last name, picture,age..) and i want to submit all this information into my database , i know how to do it for a simple input but with the picture i have some problem
can someone help me please
my html file is
<form action="insertion.php" method="post" >
<table >
<tr>
<td><strong>Titre</strong></td>
<td><input name="titre" type="text" value="" /></td>
</tr>
<tr>
<td><strong>Annee</strong></td>
<td><input name="annee" type="number" value="" /></td>
</tr>
<tr>
<td><strong>Genre musical</strong></td>
<td><input name="Gmusical" type="texte" value="" /></td>
</tr>
<tr>
<td>
<strong>Picture</strong>
</td>
<td>
<input type="file" name="img"/>
</td>
</tr>
</table>
<input type="submit" value="Submit " />
</form>
my file insertion.php to sublmit into the database is
<?php
include("connexion.php");
$titre=$_POST['titre'];
$annee=$_POST['annee'];
$Gmusical=$_POST['Gmusical'];
$picture=$_POST['img'];
$req="INSERT INTO `cd`
(`titre`, `Annee`, `genremusical`, `Image`)
VALUES
('$titre','$annee','$Gmusical','$picture');";
if (mysql_query($req))
{
echo "ok";
}
else
echo 'ko';
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…