Lav 5 uploads og gør det samme
Hejsa, jeg har et system her hvor den uplaoder et billede og lave en lille og mellem og sletter det store billede man uplaoder, er der så nogle der kan lave så den håndtere 5 pr. gang? Med noget array eller noget?<?
session_start();
if(!$_SESSION[userid]) {
include('login.php');
exit;
} else {
if(isset($_POST[partyid])) {
include('sql.php');
mysql_query("INSERT INTO fuck_pictures (partyid) VALUES ('$_POST[partyid]')") or die(mysql_error());
$til = "images/pictures/".mysql_insert_id()."_big.jpg";
$til_mellem = "images/pictures/".mysql_insert_id().".jpg";
$til_lille = "images/pictures/".mysql_insert_id()."_lille.jpg";
copy($_FILES["picture"]["tmp_name"],$til);
$width_lille = 75;
$height_lille = 56;
$dst_img = imagecreatetruecolor($width_lille,$height_lille);
$src_img=ImageCreateFromJpeg("$til");
ImageCopyResampled($dst_img,$src_img,0,0,0,0,$width_lille,$height_lille,ImageSX($src_img),ImageSY($src_img));
ImageJpeg($dst_img, $til_lille, 100);
$width_mellem = 400;
$height_mellem = 300;
$dst_img_mellem = imagecreatetruecolor($width_mellem,$height_mellem);
$src_img_mellem =ImageCreateFromJpeg("$til");
ImageCopyResampled($dst_img_mellem,$src_img_mellem,0,0,0,0,$width_mellem,$height_mellem,ImageSX($src_img_mellem),ImageSY($src_img_mellem));
ImageJpeg($dst_img_mellem, $til_mellem, 100);
unlink("images/pictures/".mysql_insert_id()."_big.jpg");
header("Location: admin.php");
exit;
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="TITLE" content="FestUdvalgets Central Komité">
<meta name="DESCRIPTION" content="FestUdvalgets Central Komité">
<meta name="AUTHOR" content="Anders Bøvling">
<meta name="KEYWORDS" content="fest,fester,feste,drikke,drik,øl,sprut,alkohol,vin,party,partyfreak,freak,skive,gym,gymnasium,gymfest,gymfester">
<meta name="ROBOTS" content="ALL">
<meta name="OWNER" content="andersbovling@gmail.com">
<meta name="SUBJECT" content="Party">
<meta name="RATING" content="General">
<meta name="REVISIT-AFTER" content="7 DAYS">
<meta name="COPYRIGHT" content="Anders Bøvling">
<meta name="LANGUAGE" content="dan">
<meta http-equiv="imagetoolbar" content="no">
<meta http-equiv="imagetoolbar" content="false">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body {
scrollbar-arrow-color: #393939;
scrollbar-track-color: #393939;
scrollbar-face-color: #DFDFDF;
scrollbar-shadow-color: #393939;
scrollbar-highlight-color: #393939;
scrollbar-darkshadow-color: #393939;
scrollbar-3dlight-color: #393939;
font : 11px tahoma, sans-serif;
color : #DFDFDF;
background-color : #393939;
margin : 0;
}
table {
font : 11px tahoma, sans-serif;
color : #DFDFDF;
}
A:link {
text-decoration : underline;
}
A:active {
text-decoration : underline;
}
A:visited {
text-decoration : underline;
}
A:hover {
text-decoration : none;
}
hr {
border-color : #000000;
border-style : solid;
}
input,select,option,textarea {
font : 11px tahoma, sans-serif;
}
</style>
<title>FestUdvalgets Central Komité</title>
</head>
<body link="#DFDFDF" vlink="#DFDFDF" alink="#DFDFDF">
<p align="center"><a href="admin.php">ADMIN</a> - <a href="logoff.php">LOG AF</a></p>
<?
include('sql.php');
echo '<p><div align="center">
<table border="0" width="450" cellspacing="0" cellpadding="0"><tr><td width="100%" height="22" style="background-image: url(\'images/bottom.jpg\'); border-left: 1px solid #000000; border-right: 1px solid #000000" align="center"><p><b><font color="#000000">Tilføj medlemmer af crew\'et</font></b></p></td></tr><tr><td width="100%" style="border-left-width:1px;border-left-style:solid;border-left-color:#000000;border-right-width:1px;border-right-style:solid;border-right-color:#000000;padding-left:3px;padding-right:3px;" bgcolor="#313131"><p>';
echo '<form method="POST" action="admin_pictures_add.php" enctype="multipart/form-data">Tilføj til:<br><select name="partyid" size="1">';
echo '<option>Vælg dato:</option>';
$usernames = mysql_query("SELECT * FROM fuck_party WHERE status = 'over' ORDER BY id DESC");
while($user = mysql_fetch_array($usernames)) {
echo '<option value="'.$user[id].'">'.$user[date].' | '.$user[time].'</option>';
}
echo '</select>';
echo '<br><br>Billede:<br><input type="file" name="picture"><br><br>';
echo '<input type="submit" value="Upload" name="submit"></p>';
echo '</form>';
echo '</p></td></tr><tr><td width="100%" height="22" style="background-image: url(\'images/bottom.jpg\'); border-left: 1px solid #000000; border-right: 1px solid #000000"><font color="#000000"> <i><b>F.U.C.K</b></i></font></td></tr></table></div></p>';
?>
</body>
</html>
<?
}
?>
