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
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>UPLOAD</title>
</head>
<body>
<?PHP
require ("connect.php");
$movie=$_REQUEST["movie"];
$song=$_REQUEST["song"];
$songurl=$_REQUEST["songurl"];
if ($_REQUEST["submit"]!=""){
if(empty($movie)||empty($song)||empty($songurl))
die("ERREUR : tous les champs doivent être remplis.");
if (is_uploaded_file($_FILES['image']['tmp_name'])){
move_uploaded_file($_FILES['image']['tmp_name'],'images/'.$_FILES['image']['name']);
echo "<img src=images/".$_FILES['image']['name'].">";
$image='images/'.$_FILES['image']['name'];
}else{die ("Problème d'envoi de fichier [image]");}
$liendb = mysql_connect("$host", "login", "password");
mysql_select_db("$db");
$sql = "INSERT INTO tamilxtreme (movie, song, image, url) ";
$sql.= " VALUES ('$movie', '$song', '$image', '$url')";
mysql_query($sql);
echo "$movie, $song, $image, $url => ajouté sans probleme";
mysql_close($liendb);
}
?>
</body>
</html> |