Voll Upload SGD Fachinformatiker PHP
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf8">
|
||||
<title>Bildinformationen auslesen</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bildinformationen auslesen</h1>
|
||||
<img src="img/b1.jpg" alt="Tour in die Weinberge" width="300"><hr>
|
||||
<?php
|
||||
$image = "img/b1jpg";
|
||||
$info = getimagesize($image);
|
||||
foreach ($info as $key => $val){
|
||||
echo "$key: $val <br>";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
$image = imagecreate(300, 150);
|
||||
$bgc = imagecolorallocate($image, 243, 3, 43);
|
||||
imagefill ($image,0,0,$bgc);
|
||||
imagegif($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
$image = imagecreate(400, 450);
|
||||
|
||||
/* Mehrere Farben erzeugen */
|
||||
|
||||
$bgc = imagecolorallocate($image, 230, 230, 230);
|
||||
|
||||
$fc1 = imagecolorallocate($image, 255, 0, 0);
|
||||
|
||||
$fc2 = imagecolorallocate($image, 42, 243, 3);
|
||||
|
||||
$fc3 = imagecolorallocate($image, 0, 12, 200);
|
||||
|
||||
/* Hintergrundfarbe der Arbeitsfläche*/
|
||||
|
||||
imagefill($image, 0, 0, $bgc);
|
||||
|
||||
/* Rechtecke erzeugen*/
|
||||
|
||||
imagerectangle($image, 50, 60, 230, 90, $fc1);
|
||||
|
||||
imagefill($image, 60, 65, $fc2);
|
||||
|
||||
imagerectangle($image, 20, 360, 130, 30, $fc1);
|
||||
|
||||
imagefilledrectangle($image, 270, 160, 330, 290, $fc2);
|
||||
|
||||
/* Winkel */
|
||||
|
||||
imagearc($image, 150, 160, 200, 100, 0, 180, $fc1);
|
||||
|
||||
imagearc($image, 150, 360, 200, 100, 0, 360, $fc1);
|
||||
|
||||
imagefill($image, 160, 365, $fc3);
|
||||
|
||||
/* Ein Zeichen zeichnen */
|
||||
|
||||
imagechar($image, 5, 100, 150, 'R', $fc1);
|
||||
|
||||
imagepng($image);
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
$image = imagecreate(350, 150);
|
||||
$bgc = imagecolorallocate($image, 230, 230, 230);
|
||||
$fc =imagecolorallocate($image, 255, 0, 0);
|
||||
imagettftext($image, 120, 0,10, 140, $fc,"fonts/tahoma.ttf", "PHP" );
|
||||
imagejpeg($image);
|
||||
imagedestroy($image);
|
||||
?>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
// Zeichern, die der Captchacode enthalten darf
|
||||
$moeglicheZeichen = "abcdefghijklmnopqrstuvwxyz123456789" . "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
//Anzahl der Zeichen, die das Captcha enthalten soll
|
||||
$anzahlZeichen = 4;
|
||||
//Capcha variable
|
||||
$captchacode = "";
|
||||
|
||||
// Füllen der Captcha-Variable mit der festgelegten
|
||||
// Anzahl zufälliger Zeichen
|
||||
|
||||
for ($i = 0; $i < $anzahlZeichen; $i++) {
|
||||
$captchacode .= substr($moeglicheZeichen,
|
||||
(rand() % (strlen($moeglicheZeichen))), 1);
|
||||
}
|
||||
|
||||
header('Content-type: image/jpg');
|
||||
$image = imagecreate(350, 130);
|
||||
$farben = array();
|
||||
|
||||
for ($i = 0; $i < $anzahlZeichen; $i++) {
|
||||
$farben[$i] = imagecolorallocate($image,
|
||||
rand(0, 255), rand(0, 255), rand(0, 255));
|
||||
}
|
||||
|
||||
$bgc = imagecolorallocate($image, 230, 230, 230);
|
||||
|
||||
imagefill($image, 0, 0, $bgc);
|
||||
|
||||
for ($i = 0; $i < $anzahlZeichen; $i++) {
|
||||
imagettftext($image, rand(20, 80), rand(-20, 60),
|
||||
50 + ($i * 50), rand(80, 120),
|
||||
$farben[rand(0, $anzahlZeichen - 1)],
|
||||
"fonts/Anorexia.ttf", $captchacode[$i]);
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $anzahlZeichen; $i++) {
|
||||
imageline($image, rand(0, 10), rand(0, 150),
|
||||
rand(330, 340), rand(0, 150), $farben[$i]);
|
||||
}
|
||||
|
||||
imagejpeg($image);
|
||||
|
||||
imagedestroy($image);
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Bild Zeichnen</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bilder Zeichnen</h1>
|
||||
<img src="bildgenerieren1.php" alt="">
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Bild Zeichnen</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bilder Zeichnen</h1>
|
||||
<img src="bildgenerieren2.php" alt="">
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Bild Zeichnen</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bilder Zeichnen</h1>
|
||||
<img src="bildgenerieren3.php" alt="">
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<title>Bild Zeichnen</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Bilder Zeichnen</h1>
|
||||
<img src="bildgenerieren4.php" alt="">
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
if (!empty($_FILES['datei']['name'])){
|
||||
if (move_uploaded_file($_FILES['datei']['name'], 'upload/' .$_FILES['datei']['name'])) {
|
||||
echo 'Upload der Datei ' . $_FILES['datei']['name'] . ' beendet <br>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
if ($_FILES['datei']['error'] == 2) {
|
||||
echo "Es gab bein Hochladen der Datei ein Problem.<br>";
|
||||
echo "Die Dateigröße ist auf 30.000 byte beschränkt.<br>";
|
||||
}
|
||||
|
||||
if (!empty($_FILES['datei']['name'])){
|
||||
if (move_uploaded_file($_FILES['datei']['name'], 'upload/' .$_FILES['datei']['name'])) {
|
||||
echo 'Upload der Datei ' . $_FILES['datei']['name'] . ' beendet <br>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
if (isset($_FILES['datei'])) {
|
||||
if (($_FILES['datei']['size'] > 30000) || (filesize($_FILES['datei']['tmp_name']) > 30000)) {
|
||||
echo "Die Dateigröße ist auf " . "30.000 Byte beschränkt.<br>";
|
||||
} else if (!empty($_FILES['datei']['name'])) {
|
||||
if (move_uploaded_file($_FILES['datei']['tmp_name'], 'upload/' . $_FILES['datei']['name'])) {
|
||||
echo 'Upload der Datei ' . $_FILES['datei']['name'] . ' beendet<br>';
|
||||
echo 'Der MIME-Type der Datei: ' . $_FILES['datei']['type'] . '<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
Maria Mustermann#mm@mm.de#Ich war hier!
|
||||
Frank Fischer#franky@fischer.com#Tolle Seite, weiter so :)
|
||||
|
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
function ausgabeGaestebuch(){
|
||||
$fp = @fopen('gaestebuch.csv', 'r');
|
||||
if ($fp == false) {
|
||||
$fp = fopen('gaestebuch.csv', 'w');
|
||||
fclose($fp);
|
||||
} else{
|
||||
$counter = 0;
|
||||
while ($zeile =fgetcsv($fp, 500, "#")) {
|
||||
echo ++$counter . ".<br>";
|
||||
echo "NAME: " . $zeile[0];
|
||||
echo "<br>E-Mail: " . $zeile[1];
|
||||
echo "<br>Kommentar: " . $zeile[2] . "<hr>";
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
function eintragenGaestebuch(){
|
||||
if (isset($_GET['name']) AND isset($_GET['email']) AND isset($_GET['kommentar'])) {
|
||||
if (($_GET['name'] != '') AND ($_GET['email'] != '') AND ($_GET['kommentar'] != '')) {
|
||||
$str = $_GET['name'] . "#" . $_GET['email'] . "#" . $_GET['kommentar'] . "\n";
|
||||
$fp = fopen("gaestebuch.csv", 'a');
|
||||
fwrite($fp, $str);
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Gästebuch</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Gästebuch</h1>
|
||||
<h2>Bisherige Einträge</h2>
|
||||
<?php
|
||||
require("gaestebuch.inc.php");
|
||||
eintragenGaestebuch();
|
||||
ausgabeGaestebuch();
|
||||
?>
|
||||
<h2>Ihr Beitrag zu unserem Gästebuch</h2>
|
||||
<form action="gaestebuch.php">
|
||||
Name: <input name="name"><br>
|
||||
E-Mail <input name="email"><br>
|
||||
Kommentar <br>
|
||||
<textarea name="kommentar" cols="50" rows="5"></textarea><br>
|
||||
<input type="submit">
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>Gästebuch</title>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<h1> Gästebuch </h1>
|
||||
|
||||
<h2>Bisherige Einträge</h2>
|
||||
|
||||
<?PHP
|
||||
|
||||
require ("gaestebuch.inc.php");
|
||||
|
||||
eintragenGaestebuch();
|
||||
|
||||
ausgabeGaestebuch();
|
||||
|
||||
?>
|
||||
|
||||
<h2>Ihr Beitrag zu unserem Gästebuch </h2>
|
||||
|
||||
<form action="gaestebuch2.php">
|
||||
|
||||
Name: <input name="name"><br>
|
||||
|
||||
E-Mail: <input name="email"> <br>
|
||||
|
||||
Kommentar <br>
|
||||
|
||||
<textarea name="kommentar" cols="50" rows="5">
|
||||
|
||||
</textarea><br>
|
||||
|
||||
<input type="submit">
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.7 MiB |
Binary file not shown.
|
After Width: | Height: | Size: 177 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
$source = "gaestebuch.csv";
|
||||
$destination = "gaestebuch.bak";
|
||||
|
||||
if(@copy($source, $destination)) {
|
||||
echo "Letzte Änderung und Modifizierung " . "der Quelldatei: " . filemtime($source) . ", " . filectime($source) . "<br>";
|
||||
echo "Letzte Änderung und Modifizierung " . "der Quelldatei: " . filemtime($destination) . ", " . filectime($destination) . "<br>";
|
||||
} else {
|
||||
echo "Fehler beim Kopieren";
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
$fn = "gaestebuch.csv";
|
||||
|
||||
echo "Dateigröße: " . filesize($fn) . "<br>";
|
||||
echo "Datei lesbar: " . is_readable($fn) . "<br>";
|
||||
echo "Datei schreibbar: " . is_writable($fn) . "<br>";
|
||||
echo "Dateityp: " . filetype($fn) . "<br>";
|
||||
echo "Verzeichnis: " . is_dir($fn) . "<br>";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
echo 'Freier Speicher mit diskfreespace(".") ' . diskfreespace(".") . ' Byte' . "<br>";
|
||||
|
||||
echo 'Gesamter Speicherplatz mit disk_total_space("."): ' . disk_total_space('.') . ' Byte' . "<br>";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
if (!empty($_FILES['datei']['name'])) {
|
||||
|
||||
if (move_uploaded_file($_FILES['datei']['tmp_name'],
|
||||
|
||||
'upload/' . $_FILES['datei']['name'])) {
|
||||
|
||||
echo 'Upload der Datei ' .
|
||||
|
||||
$_FILES['datei']['name'] . ' beendet<br>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Uploadformular</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Wählen Sie eine Datei zum Upload aus</h1>
|
||||
|
||||
<form action="dateispeichern3.php" method="post" enctype="multipart/form-data">
|
||||
<input name="datei" type="file"><br>
|
||||
<input type="submit" value="Starte Upload">
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Uploadformular</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Wählen Sie eine Datei zum Upload aus</h1>
|
||||
|
||||
<form action="dateispeichern2.php" method="post" enctype="multipart/form-data">
|
||||
<input name="datei" type="file"><br>
|
||||
<input name="MAX_FILE_SIZE" type="hidden" value="30000">
|
||||
<input type="submit" value="Starte Upload">
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
<?php
|
||||
|
||||
$fp = @fopen('z.txt', 'r');
|
||||
if ($fp == false) {
|
||||
|
||||
$str = 1;
|
||||
$fp = fopen('z.txt', 'w');
|
||||
fclose($fp);
|
||||
|
||||
} else {
|
||||
|
||||
$str = fgets($fp, 11);
|
||||
fclose($fp);
|
||||
|
||||
}
|
||||
|
||||
echo $str++;
|
||||
|
||||
$fp = fopen('z.txt', 'w');
|
||||
fputs($fp, $str, 11);
|
||||
fclose($fp);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user