<?
if($_POST[Submit])
{
if($_POST[anderecategorie]!="")
{
$uploadmapfoto = "Gallery/Overige/";
$uploadmapfoto2 = "Gallery/Overige_th/";
$cat = "Overige";
}
else
{
$uploadmapfoto = "Gallery/".$_POST[categorie]."/";
$uploadmapfoto2 = "Gallery/".$_POST[categorie]."_th/";
$cat = $_POST[categorie];
}
{
}
else
{
$foto="";
$error = "error";
$error_foto = " <font size='2' color='red'>Je hebt geen foto geupload.</font>";
}
{
$bestand_namefoto = $_FILES['foto']['name']; //naam van het geuploade bestand
$bestand_typefoto = $_FILES['foto']['type'];
$bestand_sizefoto = $_FILES['foto']['size']; //grootte in bytes van het geuploade bestand
$width = $plaatje[0];
$height = $plaatje[1];
if ($width>500)
{
$error = "error";
$error_foto = " <font size='2' color='red'>Het bestandsnaam ".$bestand_namefoto." is meer dan 500px breed ! Verklein het bestand.</font>";
}
{
$error = "error";
$error_foto = " <font size='2' color='red'>Het bestandsnaam ".$bestand_namefoto." is al eens gebruikt ! Hernoem het bestand.</font>";
}
if($bestand_typefoto != "image/pjpeg")
{
$error = "error";
$error_foto = " <font size='2' color='red'>Het bestandsnaam ".$bestand_namefoto." is geen .jpg bestand! Verander dit op je pc.</font>";
}
}
if($_POST[categorie] == "_selecteer_" AND $_POST[anderecategorie] == "")
{
$error = "error";
$error_categorie = " <font size='2' color='red'>Je hebt geen categorie geselecteerd.</font>";
}
if($error=="error")
{
echo "<form method='post' name='formulier' action='index.php?p=upload' enctype='multipart/form-data'>"; ?>
<table width="100%" border="0" cellspacing="2">
<tr>
<td width="29%">Categorie:</td>
<td width="71%">
<select name="categorie">
<?
if($_POST[categorie]=="_selecteer_")
echo "<option selected>_selecteer_</option>"; else
echo "<option>_selecteer_</option>"; if($_POST[categorie]=="Hannibal")
echo "<option selected>Hannibal</option>"; else
echo "<option>Hannibal</option>"; if($_POST[categorie]=="Murdock")
echo "<option selected>Murdock</option>"; else
echo "<option>Murdock</option>"; if($_POST[categorie]=="Face")
echo "<option selected>Face</option>"; else
echo "<option>Face</option>"; if($_POST[categorie]=="Ba")
echo "<option selected>Ba</option>"; else
echo "<option>Ba</option>"; if($_POST[categorie]=="Amy")
echo "<option selected>Amy</option>"; else
echo "<option>Amy</option>"; if($_POST[categorie]=="Franky")
echo "<option selected>Franky</option>"; else
echo "<option>Franky</option>"; if($_POST[categorie]=="Lynch")
echo "<option selected>Lynch</option>"; else
echo "<option>Lynch</option>"; if($_POST[categorie]=="Stockwell")
echo "<option selected>Stockwell</option>"; else
echo "<option>Stockwell</option>"; if($_POST[categorie]=="Van")
echo "<option selected>Van</option>"; else
echo "<option>Van</option>"; if($_POST[categorie]=="corvette")
echo "<option selected>corvette</option>"; else
echo "<option>corvette</option>"; if($_POST[categorie]=="Groep")
echo "<option selected>Groep</option>"; else
echo "<option>Groep</option>"; if($_POST[categorie]=="Episode")
echo "<option selected>_Episode</option>"; else
echo "<option>Episode</option>"; if($_POST[categorie]==">Andere")
echo "<option selected>>Andere</option>"; else
echo "<option>>Andere</option>"; ?>
</select><br><?=$error_categorie ?>
</td>
</tr>
<tr>
<td width="29%">Andere categorie:</td>
<td width="71%">
<input type="text" name="anderecategorie" value="<?=$_POST[anderecategorie] ?>">
</td>
</tr>
<td>Foto:</td>
<td>
<? if($error_foto!="")
{
?>
<input type="file" name="foto"><br><?=$error_foto ?>
<?
}
else
{
echo "<b>Foto ".$bestand_namefoto." is geupload.</b>"; }?>
</td>
</tr>
<tr>
<td colspan="2" height="50" align="center">
<input type="submit" name="Submit" value="Opslaan">
<input type="reset" name="Reset" value="Wissen">
</td>
</tr>
<tr>
<td colspan="2" height="50">
Velden met zijn verplicht.
</td>
</tr>
</table>
<?
}
elseif($error=="")
{
{
$width2=$width;
for($height2=$height;$width2>150 OR $height2>150;$height2=$height2/1.1)
{
$width2=$width2/1.1;
}
$im = imagecreatefromjpeg($uploadmapfoto.$bestand_namefoto);
$new = imagecreatetruecolor($width2,$height2);
imagecopyresampled($new, $im, 0, 0, 0, 0, $width2, $height2, imagesx($im), imagesy($im));
imagedestroy($im);
imagejpeg($new, $uploadmapfoto2.$bestand_namefoto);
imagedestroy($new);
}
mail("info@ateamfans.nl", "Foto geupload", "Hallo Er is een foto geupload.
Url: http://www.ateamfans.nl/$uploadmapfoto.$bestand_namefoto
Categorie: $cat
Gezonden door: $gebruiker
", "From: $gebruiker<info@ateamfans.nl>\nReturn-path: info@ateamfans.nl");
?>
<center><b>!DE GEGEVENS ZIJN SUCCESVOL GEUPLOAD!</b></center>
<META HTTP-EQUIV='Refresh' CONTENT='1; URL=index.php'>
<?
}
}
else
{
echo "<form method='post' name='formulier' action='index.php?p=upload' enctype='multipart/form-data'>"; ?>
<table width="100%" border="0" cellspacing="2">
<tr>
<td width="29%">Categorie:</td>
<td width="71%">
<select name="categorie">
<option>_selecteer_</option>
<option>Hannibal</option>
<option>Murdock</option>
<option>Face</option>
<option>Ba</option>
<option>Amy</option>
<option>Franky</option>
<option>Lynch</option>
<option>Stockwell</option>
<option>Van</option>
<option>corvette</option>
<option>Groep</option>
<option>Episode</option>
<option>Andere</option>
</select>
</td>
</tr>
<tr>
<td width="29%">Andere categorie:</td>
<td width="71%">
<input type="text" name="anderecategorie">
</td>
</tr>
<td>Foto:</td>
<td>
<input type="file" name="foto">
</td>
</tr>
<tr>
<td colspan="2" height="50" align="center">
<input type="submit" name="Submit" value="Opslaan">
<input type="reset" name="Reset" value="Wissen">
</td>
</tr>
<tr>
<td colspan="2" height="50">
Velden met zijn verplicht.
</td>
</tr>
</table>
</form>
<?
}
?>