<?php
// Token extrahieren
$str_post_token = $_POST['token'];
// Wenn Token als Session Variable existiert
// wurde das Formular bereits versandt
if (isset($_SESSION['token'][$str_post_token])) {
echo "Sie haben das Formular bereits versandt!";
exit;
} else {
// setzen des Tokens als Session-Variable
$_SESSION['token'][$str_post_token] = true;
}
if ($_REQUEST['submit']) {
if ($_FILES['Datei2']['name']) {
// Ueberpruefung der Dateigroesse
// maximal erlaube Dateigroesse in Bytes
$int_max_filesize = 10000000;
// eigentliche Ueberpruefung
if ($_FILES['Datei2']['size'] > $int_max_filesize) {
echo "Datei ist zu gross - Abbruch!";
exit;
}
// Ueberpruefung der Dateiendung
// Dateiendung ermitteln
$str_file_ext = substr(strtolower(strrchr($_FILES['Datei2']['name'], '.')), 1);
// Array der zulaessigen Endungen
$idxarr_allowed_ext = array('html', 'php', 'txt', 'php5', 'php4');
// Ueberpruefung der Dateiendung
if (empty($str_file_ext) or !in_array($str_file_ext, $idxarr_allowed_ext)) {
echo "Unzulaessige Dateiendung!";
exit;
}
$filename = $_FILES['Datei2']['name'];
move_uploaded_file($_FILES['Datei2']['tmp_name'], "upload/" . $_FILES['Datei2']['name']);
rename("upload/$filename", "upload/$nachname.$vorname.$email.$filename");
} else {
echo "Bitte geben Sie eine Datei an!";
}
}
/* echo"Ihre Datei ("",
$_FILES['Datei2']['name'],
"") ist ",
$_FILES['Datei2']['size'],
" Bytes groß."; */
if ($more == 1) {
if (empty($_POST['but1'])) {
header("Location: hpver.php?fehler=2");
}
if (empty($_POST['but2'])) {
header("Location: hpver.php?fehler=3");
}
if (empty($_POST['but3'])) {
header("Location: hpver.php?fehler=4");
}
if (empty($_POST['but4'])) {
header("Location: hpver.php?fehler=5");
}
if (empty($_POST['but5'])) {
header("Location: hpver.php?fehler=6");
if (empty($_POST['but6'])) {
header("Location: hpver.php?fehler=7");
if (empty($_POST['but7']))
header("Location: hpver.php?fehler=8");
}
if (empty($_POST['but8'])) {
header("Location: hpver.php?fehler=9");
}
if (empty($_POST['but9'])) {
header("Location: hpver.php?fehler=10");
}
if (empty($_POST['but10'])) {
header("Location: hpver.php?fehler=11");
}
if (empty($_POST['but11'])) {
header("Location: hpver.php?fehler=12");
if (empty($_POST['but12'])) {
header("Location: hpver.php?fehler=13");
}
} elseif ($more == 0) {
if (empty($_POST['but1'])) {
header("Location: hpver.php?fehler=2");
}
if (empty($_POST['but2'])) {
header("Location: hpver.php?fehler=3");
}
if (empty($_POST['but3'])) {
header("Location: hpver.php?fehler=4");
}
if (empty($_POST['but4'])) {
header("Location: hpver.php?fehler=5");
}
if (empty($_POST['but5'])) {
header("Location: hpver.php?fehler=6");
}
}
if ($des == none) {
header("Location: hpver.php?fehler=1");
} elseif ($des == hptoolsl) {
$des2 = hptoolsl;
$more = 1;
} elseif ($des == hptools) {
$des2 = hptools;
$more = 0;
$fp = fopen("datei1.php", "w");
chmod("datei1.php", 0777);
rename("datei1.php", "$nachname.$vorname.$email.datei1.php");
$text1 = 'Header ("Content-type: image/png"); $im = imagecreatefromjpeg("bil.jpeg");';
$text2 = "$black = ImageColorAllocate ($im, 0, 0, 0);";
$text3 = "ImageTTFText ($im, 25, 0, 17, 36, $black, 'Fonts/Arial_Blackf', $but5);";
$text4 = "ImagePng ($im); ImageDestroy ($im);";
$text = $text1 . $text2 . $text3 . $text4;
fwrite($fp, $text);
flose($fp);
$fp = fopen("datei2.php", "w");
chmod("datei2.php", 0777);
rename("datei2.php", "$nachname.$vorname.$email.datei2.php");
$text1 = 'Header ("Content-type: image/png"); $im = imagecreatefromjpeg("bil2.jpeg");';
$text2 = "$black = ImageColorAllocate ($im, 0, 0, 0);";
$text3 = "ImageTTFText ($im, 25, 0, 18.5, 36, $black, 'Fonts/Arial_Blackf', $but4);";
$text4 = "ImagePng ($im); ImageDestroy ($im);";
$text = $text1 . $text2 . $text3 . $text4;
fwrite($fp, $text);
flose($fp);
$fp = fopen("datei3.php", "w");
chmod("datei3.php", 0777);
rename("datei3.php", "$nachname.$vorname.$email.datei3.php");
$text1 = 'Header ("Content-type: image/png"); $im = imagecreatefromjpeg("bil3.jpeg");';
$text2 = "$black = ImageColorAllocate ($im, 0, 0, 0);";
$text3 = "ImageTTFText ($im, 25, 0, 21, 36, $black, 'Fonts/Arial_Blackf', $but3);";
$text4 = "ImagePng ($im); ImageDestroy ($im);";
$text = $text1 . $text2 . $text3 . $text4;
fwrite($fp, $text);
flose($fp);
$fp = fopen("datei4.php", "w");
chmod("datei4.php", 0777);
rename("datei4.php", "$nachname.$vorname.$email.datei4.php");
$text1 = 'Header ("Content-type: image/png"); $im = imagecreatefromjpeg("bil4.jpeg");';
$text2 = "$black = ImageColorAllocate ($im, 0, 0, 0);";
$text3 = "ImageTTFText ($im, 25, 0, 19, 36, $black, 'Fonts/Arial_Blackf', $but2);";
$text4 = "ImagePng ($im); ImageDestroy ($im);";
$text = $text1 . $text2 . $text3 . $text4;
fwrite($fp, $text);
flose($fp);
$fp = fopen("datei5.php", "w");
chmod("datei5.php", 0777);
rename("datei5.php", "$nachname.$vorname.$email.datei5.php");
$text1 = 'Header ("Content-type: image/png"); $im = imagecreatefromjpeg("bil5.jpeg");';
$text2 = "$black = ImageColorAllocate ($im, 0, 0, 0);";
$text3 = "ImageTTFText ($im, 25, 0, 17, 36, $black, 'Fonts/Arial_Blackf', $but1);";
$text4 = "ImagePng ($im); ImageDestroy ($im);";
$text = $text1 . $text2 . $text3 . $text4;
fwrite($fp, $text);
flose($fp);
} elseif ($des == oldl) {
$des2 = oldl;
$more = 1;
} elseif ($des == old) {
$des2 = old;
$more = 0;
} elseif ($des == holzl) {
$des2 = holzl;
$more = 1;
} elseif ($des == holz) {
$des2 = holz;
$more = 0;
}
?>