Also ich hab folgenden code:
aber irgednwie spuckt der mir immer:
weiß jmd woran das liegen könnte?
PHP:
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?
if(isset($file)) {
echo "Datei Informationen: $file, $file_name, $file_size, $file_type<br><br>";
if($file != "none") {
if(copy($file,"/home/www/n4a287/test/v4/upload".$file)) {
$today = date("j, n, Y");
$sql = "INSERT INTO ws_tutorial SET
bild='".$file_name."',
text='".$_POST[text]."',
nick='".$_SESSION['user_name']."',
cat='".$_POST[cat]."',
beschreibung='".$_POST[beschreibung]."',
date='".$today."',
frei='0'
";
$lool=mysql_query($sql);
echo "Upload vollständig";
} else {
echo "Upload fehlgeschlagen";
}
} else {
echo "Eine Datei zum Uploaden muss man schon zur Verfügung stellen";
}
} else {
?>
<body>
<form name="form1" enctype="multipart/form-data" method="post" action="<? $_SERVER['PHP_SELF'] ?>">
<table width="443" height="116" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="70" height="19">Name:</td>
<td width="361"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td height="19">Kategorie:</td>
<td><select name="cat">
<?php
$sql_get = "select * from ws_tutorials_cat";
$res = mysql_query($sql_get);
while( $info1 = mysql_fetch_array( $res,MYSQL_ASSOC ) ) {
print "<option value='$info1[cat]'>$info1[cat]</option>";
}
?>
</select></td>
</tr>
<tr>
<td height="19">Bild:</td>
<td> <input type="file" name="file" value="max 20 KB"> <input type=hidden name="MAX_FILE_SIZE" value="20480">
<?
}
?>
</td>
</tr>
<tr>
<td>Beschreibung:</td>
<td><input name="beschreibung" type="text" id="beschreibung"></td>
</tr>
<tr>
<td>Tutorial:</td>
<td><a href="bbcode.php" target="_blank">BBcode</a> <a href="smiley.php" target="_blank">Smiley</a></td>
</tr>
<tr>
<td> </td>
<td><textarea name="text" cols='40' rows='17' id="text"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Upload!"></td>
</tr>
</table>
</form>
</body>
</html>
aus,Datei Informationen: /home/www/n4a287/phptmp/phpEjY1QO, 1.gif, 676, image/gif
Upload fehlgeschlagen
weiß jmd woran das liegen könnte?