ich hab ein upload script und ein formular kombiniert. das problem liegt jetzt darin, dass die umwandlung bzw. das umbenennen und verschieben der datei vom temporären ins gewünschte verzeichnis nicht funktioniert.
ich habe den quelltext mal angehängt.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
include ('./extras/dbconnect.inc.php');
mysql_select_db($database);
if(isset($cmd))
mysql_query("INSERT INTO zine_reviews (date, band, album, label, year, text, reviewer, email, score, cover, url, url_title) VALUES ('$date','$band','$album','$label','$year','$text','$reviewer','$email','$score','$cover','$url','$u
rl_title')");
?>
<html>
<head>
<title>SBR - Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../style.css" rel="stylesheet" type="text/css">
</head>
<body background="../../images/layout2_16.jpg">
<?php if(!isset($cmd)): ?>
<form method="POST" action="reviews_insert.php" enctype="multipart/form-data">
<input type="hidden" name="cmd" value="send">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="2"><span class="newsheader"><strong>[INSERT reviews]</strong></span><br><br></td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td align="center">News-Date</td>
<td class="subhead">
<?
$datumAktuell = date("Y-m-d H:i:s");
?>
<input type="text" name="date" size="19" value="<?=$datumAktuell?>">
</td>
</tr>
<tr>
<td>Band:</td>
<td><input type="text" name="band" value="" size="50"></td>
</tr>
<tr>
<td>Album:</td>
<td><input type="text" name="album" value="" size="50"></td>
</tr>
<tr>
<td>Label:</td>
<td><input type="text" name="label" value="" size="50"></td>
</tr>
<tr>
<td>Year:</td>
<td><input type="text" name="year" value="" size="50"></td>
</tr>
<tr>
<td valign="top">Text:</td>
<td><textarea name="text" rows="6" cols="40"></textarea></td>
</tr>
<tr>
<td valign="top">Reviewer:</td>
<td><input type="text" name="reviewer" value="" size="30"></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input type="text" name="email" value="" size="30"></td>
</tr>
<tr>
<td>Score:</td>
<td><input type="text" name="score" value="" size="50"></td>
</tr>
<tr>
<td align="center" valign="middle" class="subhead" bgcolor="#B5C7DE">Bild hochladen</td>
<td class="subhead"><input name="cover" type="file" size="25"></td>
</tr>
<?
$bildname = $cover_name;
$bildnameteile = explode(".",$bildname);
$dateiEndung = $bildnameteile[1];
$path = "/xxxxxxxxxxxxxxx/php/images/reviews/";
$image = $id.".jpg";
$imagePath = $path.$image;
copy("$cover", $imagePath);
}
?>
<tr>
<td>URL:</td>
<td><input type="text" name="url" value="" size="50"></td>
</tr>
<tr>
<td>URL Title:</td>
<td><input type="text" name="url_title" value="" size="50"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Insert"></td>
</tr>
</table>
</form>
<?php else: ?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td><span class="newsheader"><strong>[RESULT]</strong></span><br><br></td>
</tr>
<tr><td> </td></tr>
<tr><td>Everything is fine.</td></tr>
</table>
<?php endif; ?>
</body>
</html>
ich habe den quelltext mal angehängt.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?php
include ('./extras/dbconnect.inc.php');
mysql_select_db($database);
if(isset($cmd))
mysql_query("INSERT INTO zine_reviews (date, band, album, label, year, text, reviewer, email, score, cover, url, url_title) VALUES ('$date','$band','$album','$label','$year','$text','$reviewer','$email','$score','$cover','$url','$u
rl_title')");
?>
<html>
<head>
<title>SBR - Admin</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../style.css" rel="stylesheet" type="text/css">
</head>
<body background="../../images/layout2_16.jpg">
<?php if(!isset($cmd)): ?>
<form method="POST" action="reviews_insert.php" enctype="multipart/form-data">
<input type="hidden" name="cmd" value="send">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="2"><span class="newsheader"><strong>[INSERT reviews]</strong></span><br><br></td>
</tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td align="center">News-Date</td>
<td class="subhead">
<?
$datumAktuell = date("Y-m-d H:i:s");
?>
<input type="text" name="date" size="19" value="<?=$datumAktuell?>">
</td>
</tr>
<tr>
<td>Band:</td>
<td><input type="text" name="band" value="" size="50"></td>
</tr>
<tr>
<td>Album:</td>
<td><input type="text" name="album" value="" size="50"></td>
</tr>
<tr>
<td>Label:</td>
<td><input type="text" name="label" value="" size="50"></td>
</tr>
<tr>
<td>Year:</td>
<td><input type="text" name="year" value="" size="50"></td>
</tr>
<tr>
<td valign="top">Text:</td>
<td><textarea name="text" rows="6" cols="40"></textarea></td>
</tr>
<tr>
<td valign="top">Reviewer:</td>
<td><input type="text" name="reviewer" value="" size="30"></td>
</tr>
<tr>
<td>E-mail:</td>
<td><input type="text" name="email" value="" size="30"></td>
</tr>
<tr>
<td>Score:</td>
<td><input type="text" name="score" value="" size="50"></td>
</tr>
<tr>
<td align="center" valign="middle" class="subhead" bgcolor="#B5C7DE">Bild hochladen</td>
<td class="subhead"><input name="cover" type="file" size="25"></td>
</tr>
<?
$bildname = $cover_name;
$bildnameteile = explode(".",$bildname);
$dateiEndung = $bildnameteile[1];
$path = "/xxxxxxxxxxxxxxx/php/images/reviews/";
$image = $id.".jpg";
$imagePath = $path.$image;
copy("$cover", $imagePath);
}
?>
<tr>
<td>URL:</td>
<td><input type="text" name="url" value="" size="50"></td>
</tr>
<tr>
<td>URL Title:</td>
<td><input type="text" name="url_title" value="" size="50"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Insert"></td>
</tr>
</table>
</form>
<?php else: ?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td><span class="newsheader"><strong>[RESULT]</strong></span><br><br></td>
</tr>
<tr><td> </td></tr>
<tr><td>Everything is fine.</td></tr>
</table>
<?php endif; ?>
</body>
</html>
Kommentar