<font face="arial"><?
$leeg = "";
if ($p == $leeg)
{
echo "<form method='POST' action='voegtoe.php'><input type='hidden' name='p' value='new'>
What's your username:<br><input type='text' name='login' size='20' maxlength='20'> <font size='1'>Only capitals and normal letters are allowed.</font><br>
Give the month:<br><input type='text' name='month' size='20' maxlength='20'> <font size='1'>In words only (eg. February, January, ...</font><br>
Give your chest-width:<br><input type='text' name='chest' size='20' maxlength='20'> <font size='1'>Only digits are allowed.</font><br>
Give your biceps-width:<br><input type='text' name='biceps' size='20' maxlength='20'> <font size='1'>Only digits are allowed.</font><br>
Give your body-weight:<br><input type='text' name='weight' size='20' maxlength='20'> <font size='1'>Only digits are allowed.</font><br>
<input type='submit' name='B1' value='Add'></form>
";
}
elseif ($p == "new")
{
include("gegevens.php");
for ($var = -1; $var <= $aantal; $var++ )
{
if ($login == $member[$var])
{
$file =
fopen("Sample/$login.csv",
"a+");
\"$month\",\"$chest\",\"$biceps\",\"$weight\"");
$check="a";
break;
}
else
{
$file =
fopen("Sample/$login.csv",
"w");
\"$month\",\"$chest\",\"$biceps\",\"$weight\"");
$check="b";
}
}
if($check=="b")
{
$aantal++;
$file =
fopen("gegevens.php",
"w");
for ($var = -1; $var <= $aantal; $var++)
{
fputs($file,
"\$member[$var] = \"$member[$var]\";");
}
fputs ($file,
"\$member[$aantal] = \"$login\";\$aantal = $aantal;?>");
}
echo "Volgende gegevens zijn toegevoegd:<br><br>Username: $login<br>Month: $month<br>Chest-width: $chest<br>Biceps-width: $biceps<br>Body-weight: $weight";
}
?></font>