Noget kode ?
Her er min:
<?php
$path = "../images/gallery/uploaded";
$httproot = "";
count($_POST)>0)
{
$userid = $row['id'];
$use_file = $_FILES['file'];
$filename = $use_file['name'];
$sti = $path."/".$filename;
$tjek_om_eks = mysql_query("SELECT * FROM gallery WHERE filnavn='$filename'");
$antal = mysql_num_rows($tjek_om_eks);
if($antal > 0){
echo "<b>Upload image</b><br><br>";
echo "A file wiht this filename alerdy existens";
}else{
if(move_uploaded_file($use_file['tmp_name'], $path."/".$filename))
{
$bes = $_POST['beskrivelse'];
$name = $_POST['name'];
echo "<b>Upload image</b><br><br>";
mysql_query("INSERT INTO gallery (sti, navn, beskrivelse, filnavn, userid) VALUES ('$sti', '$name', '$bes', '$filename', '$userid')");
echo "The file is now uploaded.<br><br><a href='gallery.php' target='teamsmg'>See it here</a>";
}
else
{
echo "<b>Upload image</b><br><br>";
echo "<b>Error</b><br><br>There is a error - the file isn't uploaded.<br><br>
<a href='http://quarde.dk/iframe/upload.php' target='teamsmg'>Try Again</a>";
}
?>
Indlæg senest redigeret d. 01.02.2007 21:03 af Bruger #8884