Voll Upload SGD Fachinformatiker PHP
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user