Der skal oprettes: udflugter.txt, som skal chmodes 666.
Tilmeld.php:
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<style type="text/css">
font { color: #000000; font-size: 11px; font-family: verdana; }
.header { color: #000000; font-size: 16px; font-family: verdana; }
div { text-align: center; }
.frmobj { float: left; font-weight: bold; padding-top: 3px; width: 90px; }
</style>
<title>Udflugter</title>
</head>
<body>
<center>
<font class="header">Tilmeldte til turen til blablabla</font>
<br><br>
<table cellspacing="0px" cellpadding="0px" style="border: 0px;">
<tr>
<td style="width: 100px; text-align: center"><font><b>Navn:</b></font></td><td style="width: 100px; text-align: center"><font><b>Telefonnr.:</b></font></td><td style="width: 100px; text-align: center"><font><b>E-mailadresse:</b></font></td>
</tr>
<?php
include("udflugter.txt");
echo "";
?>
</table>
</center>
<br><br>
<?php
$submit = "Tilmeld";
if ($action == "$submit") {
function Stripn($name)
{
$name = str_replace("'", "''", $name);
return $name;
}
function Stripd($desc)
{
$desc = str_replace("'", "''", $desc);
return $desc;
}
$name = htmlspecialchars(stripslashes(Stripn($name)));
$desc = htmlspecialchars(stripslashes(Stripd($desc)));
$link_file="udflugter.txt";
$write = "<tr><td style=\"width: 100px; text-align: center\"><font>$navn</font></td><td style=\"width: 100px; text-align: center\"><font>Telefonnr.</font></td><td style=\"width: 100px; text-align: center\"><font>E-mailadresse</font></td></tr>\n";
$fp=fopen($link_file, "a");
fwrite($fp, $write);
fclose($fp);
echo "<font>$navn er blevet tilføjet til udflugten! Tryk <a href=\"$PHP_SELF\">her</a> for at opdatere listen</font>";
?>
<?php
}
else {
print("<center>
<table cellspacing=\"0px\" cellpadding=\"0px\" style=\"border: 0px;\">
<tr>
<td>
<center>
<font class=\"header\">Tilmeld udflugt</font>
<br><br>
<form method=post action=\"tilmeld.php\">
<div class=\"frmobj\"><font>Navn:</font></div> <input type=\"TEXT\" name=\"navn\" style=\"width: 300px\"><BR>
<div class=\"frmobj\"><font>Tlf.:</font></div> <input type=\"TEXT\" name=\"tlf\" style=\"width: 300px\"><BR>
<div class=\"frmobj\"><font>E-mail:</font></div> <input type=\"TEXT\" name=\"mail\" style=\"width: 300px\"><BR>
<div class=\"frmobj\"> </div> <input type=submit name=action value=\"$submit\">
</form>
</center>
</td>
</tr>
</table>
</center>");
}
?>