Image upload
Jeg har dl'et det her script fra hotscripts.comMen det virker ikke og den siger fejl på linie et...?
<?
$abpath = "/pic";
$sizelim = "yes";
$size = "2500000";
$cert1 = "image/pjpeg";
$cert2 = "image/jpeg";
$cert3 = "image/gif";
$log = "";
if ($img1_name == "") {
$log .= "No file selected for upload 1<br>";
}
if ($img1_name != "") {
if (file_exists("$abpath/$img1_name")) {
$log .= "File 1 already existed<br>";
} else {
if (($sizelim == "yes") && ($img1_size > $size)) {
$log .= "File 1 was too big<br>";
} else {
if (($img1_type == $cert1) or ($img1_type == $cert2) or ($img1_type == $cert3)) {
@copy($img1, "$abpath/$img1_name") or $log .= "Couldn't copy image 1 to server<br>";
if (file_exists("$abpath/$img1_name")) {
$log .= "File was uploaded<br>";
}
} else {
$log .= "File 1 is not an image<br>";
}
}
}
}
<html>
<head>
<title>Image Report</title>
</head>
<body>
<p>Log:<br>
<?
echo "$log";
if ($log == "File was uploaded<br>") {
include ("config.php"); // mysql informationerne
$query = mysql_query("UPDATE TMC_members SET file='$img1_name' WHERE name='$phpclan_username'");
}
?>
</p>
<body>
<html>
