J'ai fait un formulaire d'inscription avec un input de type file, le formulaire est bon les donner son envoyer dans la bdd mais l'image placer dans file
Code : Tout sélectionner
<input type="file" name="avatar"/>voila le code verif.php (il n'y a aucune erreur aficher)
<html>
<head>
<meta http-equiv="Content-Language" content="fr">
<title>Nouvelle page 1</title>
</head>
<body background="design/fond.png">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-width: 0" bordercolor="#111111" id="AutoNumber1" width="336">
<tr>
<td width="336" style="border-style: none; border-width: medium" background="design/h.PNG">
<p align="center"><font face="Comic Sans MS" color="#000080"><b>Validation inscription</b></font></td>
</tr>
<tr>
<td width="336" style="border-style: none; border-width: medium" background="design/pagefond.gif">
<p align="center">
<?
if($_FILES['avatar']['size'] = 0 and $_FILES['avatar']['size'] = null)
{
echo 'chargement de l\'avatar echouer verifier la t\'aille du fichier. Elle doit etre inferieure a 20Ko</br>';
}
else
{
$destination = 'http://membres.lycos.fr/aafgtn/data/'.$_POST['pseudo'].'.jpg';
$temp_file = $_FILES['avatar']['tmp_name'];
move_uploaded_file($temp_file,$destination);
}
if(isset($_POST['pseudo']) and isset($_POST['email']) and isset($_POST['profil']) and isset($_POST['sexe']) and isset($_POST['mdp']))
{
if($_POST['pseudo'] != null and $_POST['email'] != null and $_POST['profil'] != null and $_POST['sexe'] != null and $_POST['mdp'] != null)
{
$pseudo = $_POST['pseudo'];
$email = $_POST['email'];
$profil = $_POST['profil'];
$sexe = $_POST['sexe'];
$mdp = $_POST['mdp'];
if(isset($destination)){$avatar = $destination;}else{$avatar="http://membres.lycos.fr/aafgtn/data/defau.jpg'";}
?>
Votre pseudo: <?echo $pseudo;?><br>
Votre email: <?echo $email;?></br>
Votre Profil: <?echo $profil;?></br>
Votre sexe: <?echo $sexe;?>
<?
mysql_connect("***","***");
mysql_select_db("aafgtn_db");
$rep=mysql_query("INSERT INTO membre VALUES('','".$pseudo."','".$email."','".$profil."','".$sexe."','".$mdp."','".$avatar."')");
mysql_close();
if($rep)
{
echo 'Merci'.$_POST['pseudo'].' de votre inscription (réussite)';
}
else
{
echo 'Erreur réinscrivez vous';
}
}
else
{
echo 'Remplisser tout les champs';
}
}
else
{
echo ' ERREUR';
}
?>
</td>
</tr>
<tr>
<td width="336" style="border-style: none; border-width: medium" background="design/b.PNG"> </td>
</tr>
</table>
<p> </p>
</body>
</html>
Merci d'avance et bonne soirée