PHP interesse |
|
Hey,
Ik ben bezig met een klein registratie systeem, ik heb nu dit:
register.php
<?php
if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST))
{
$name = $_POST['name'];
$user = mysql_query("SELECT * FROM users WHERE name='".$name."'") or die(mysql_error());
$afouten = array();
if(trim($_POST['name']) == '')
{
echo $user_forgot;
}
if(trim($_POST['pass']) == '')
{
echo $pass_forgot;
}
if(mb_strlen($_POST['name']) < '2')
{
echo $user_short;
{
if(mb_strlen($_POST['pass']) < '5')
{
echo $pass_short;
}
if(mysql_num_rows($user) > '0')
{
echo $user_exist;
}
if(strcmp($_POST['pass'], $_POST['pass2']))
{
echo $pass_notsame;
}
if(count($afouten) != 0)
{
echo $fouten."<p>";
for($fi = 0; $fi < count($afouten); $fi++)
{
echo $afouten[$fi]."<p>";
}
echo $back;
}
else
{
$pass = md5($_POST['pass']);
$level = 1;
mysql_query("INSERT INTO users(name, pass, level) VALUES ('".addslashes($name)."', '".addslashes($pass)."', '".addslashes($level)."')") or die(mysql_error());
echo $voltooid;
}
}
else //Hier geeft ie nu aan unexpected T_ELSE
{
?>
<form method="post" action="?p=register.php">
<table>
<tr>
<td><?php echo $user; ?></td> <td><input type="text" name="name" size="40" maxlength="20" /></td>
</tr>
<tr>
<td><?php echo $password; ?></td> <td><input type="password" name="pass" size="40" maxlength="30" /></td>
</tr>
<tr>
<td><?php echo $password2; ?></td> <td><input type="password" name="pass2" size="40" maxlength="30" /></td>
</tr>
<tr>
<td colspan="2"><center><input type="submit" name="submit" value="submit" /></center></td>
</tr>
</table>
</form>
<?php
}
?>
<?php if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST)) { $name = $_POST['name']; if(trim($_POST['name']) == '') { } if(trim($_POST['pass']) == '') { } { { { } { } if(strcmp($_POST['pass'], $_POST['pass2'])) { } { for($fi = 0; $fi < count($afouten); $fi++) { echo $afouten[$fi]."<p>"; } } else { $pass = md5($_POST['pass']); $level = 1; } } else //Hier geeft ie nu aan unexpected T_ELSE { ?> <form method="post" action="?p=register.php"> <table> <tr> <td> <?php echo $user; ?></td> <td><input type="text" name="name" size="40" maxlength="20" /></td> </tr> <tr> <td> <?php echo $password; ?></td> <td><input type="password" name="pass" size="40" maxlength="30" /></td> </tr> <tr> <td> <?php echo $password2; ?></td> <td><input type="password" name="pass2" size="40" maxlength="30" /></td> </tr> <tr> <td colspan="2"><center><input type="submit" name="submit" value="submit" /></center></td> </tr> </table> </form> <?php } ?>
Weet iemand wat er fout is?
|