1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
<?php
if ( isset($_POST['valider']))
{
var_dump($_POST, $_FILES);
$dossier = realpath(dirname(__file__)).'/test13/';
$fichier = basename($_FILES['fiche1']['name']);
move_uploaded_file($_FILES['fiche1']['tmp_name'], $dossier . $fichier);
$serveur="sql.free.fr";
$user="xxxxxxx";
$passwd="xxxxxxxxxx";
mysql_connect($serveur,$user,$passwd);
mysql_select_db($user);
$pseudo=htmlentities(mysql_real_escape_string($_POST['pseudo']));
$email=htmlentities(mysql_real_escape_string($_POST['email']));
$pass=htmlentities(mysql_real_escape_string($_POST['pass']));
$fiche1=htmlentities(mysql_real_escape_string($fichier));
mysql_query("INSERT INTO membre (id,pseudo,pass,email) VALUES ('','$pseudo','$pass','$email')");
mysql_query("INSERT INTO fiche_membre (id,fiche1) VALUES ('','$fiche1')");
mysql_close();
}
?>
<html>
<body>
<form action="" method="post" enctype="multipart/form-data">
Pseudo <input type="text" name="pseudo" /><br />
Password <input type="password" name="pass" /><br />
email <input type="text" name="email" /><br />
fiche <input type="file" name="fiche1" /><br />
<input type="submit" name="valider" value="valider" /><br />
</form>
</body>
</html> |