Onbekend |
|
Even testen voor je op localhost, moment, edit bericht als het lukt bij mij:)
edit:
De parse error zat niet in die regel, maar op lijn 9, deze doet het:
<?
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$password['pass'] = md5($_POST['login_pass']);
$password['check'] = md5($_POST['login_pass_check']);
$login_name = addslashes(htmlspecialchars($_POST['login_name']));
if(!empty($_POST['login_name']) AND $password['pass'] == $password['check'])
{
# account maken:
if(!is_dir('members'))
{
mkdir('members', 0777);
}
$handle = fopen('members/' . $login_name . '.php','w');
fwrite($handle, "<? \$password = \"" . $password['pass'] . "\" ?>");
fclose($handle);
$website = addslashes(htmlspecialchars($_POST['website']));
$afzender = $_POST['afzender'];
$pagina = $_POST['pagina'];
$handle = fopen('config.php','w');
fwrite($handle, "<?\n \$website = \"" . $website . "\";\n \$afzender = \"" . $afzender . "\";\n \$pagina = \"" . $pagina . "\";\n ?>");
fclose($handle);
echo "<h1>Succes!</h1>\n<p>Please delete setup.php!</p>\n";
}
else
{
echo "<h1>Foutje</h1>\n<p>Probeer het opnieuw.</b>\n";
}
}
else
{
?>
<form method="POST" action="<? echo $_SERVER['PHP_SELF']; ?>">
<h1>Create Admin account</h1>
<p>
<fieldset>
<legend>Setup Information</legend>
<p>Wat is de naam van je website?<br><input type="text" name="website" value='mijnwebsite'></p>
<p>Er wordt een registratie mail met het password verzonden, wat is de afzender van deze mail?<br><input type="text" name="afzender" value='afzender@mail.com'></p>
<p>Naar welke pagina moet er worden gegaan na het inloggen?<br><input type="text" name="pagina" value='logged.php'></p>
</fieldset>
</p>
<p>
<fieldset>
<legend>Your Information</legend>
<p>Username:<br><input type="text" name="login_name" maxlength="20"></p>
<p>Password:<br><input type="password" name="login_pass" maxlength="20"></p>
<p>Retype Password:<br><input type="password" name="login_pass_check" maxlength="20"></p>
</fieldset>
</p>
<p><input type="submit" name="submit" value="Setup"></p>
</form>
<?
}
?>
<? if($_SERVER['REQUEST_METHOD'] == 'POST') { $password['pass'] = md5($_POST['login_pass']); $password['check'] = md5($_POST['login_pass_check']); if(!empty($_POST['login_name']) AND $password['pass'] == $password['check']) { # account maken: { } $handle = fopen('members/' . $login_name . '.php','w'); fwrite($handle, "<? \$password = \"" . $password['pass'] . "\" ?>"); $afzender = $_POST['afzender']; $pagina = $_POST['pagina']; $handle = fopen('config.php','w'); fwrite($handle, "<?\n \$website = \"" . $website . "\";\n \$afzender = \"" . $afzender . "\";\n \$pagina = \"" . $pagina . "\";\n ?>"); echo "<h1>Succes!</h1>\n<p>Please delete setup.php!</p>\n"; } else { echo "<h1>Foutje</h1>\n<p>Probeer het opnieuw.</b>\n"; } } else { ?> <form method="POST" action=" <? echo $_SERVER['PHP_SELF']; ?>"> <h1>Create Admin account</h1> <p> <fieldset> <legend>Setup Information</legend> <p>Wat is de naam van je website?<br><input type="text" name="website" value='mijnwebsite'></p> <p>Er wordt een registratie mail met het password verzonden, wat is de afzender van deze mail?<br><input type="text" name="afzender" value='afzender@mail.com'></p> <p>Naar welke pagina moet er worden gegaan na het inloggen?<br><input type="text" name="pagina" value='logged.php'></p> </fieldset> </p> <p> <fieldset> <legend>Your Information</legend> <p>Username:<br><input type="text" name="login_name" maxlength="20"></p> <p>Password:<br><input type="password" name="login_pass" maxlength="20"></p> <p>Retype Password:<br><input type="password" name="login_pass_check" maxlength="20"></p> </fieldset> </p> <p><input type="submit" name="submit" value="Setup"></p> </form> <? } ?>
Good luck;-) |