mrbean Posted April 14, 2011 Share Posted April 14, 2011 Its an easy script But im not smart enough to fix it here is the code: aanmelden(php) <?php include("config.php"); if(!empty($_POST)) { if(!preg_match('/^[A-Za-z1-9-]{'.$Minimale_Wachtwoord_Karakters.',}$/', $_POST['gebruikersnaam'])) { $error = $error+1; echo "Je gebruikersnaam moet minimaal 3 tekens bevaten en mag geen komma of andere onbedoelde tekens zijn<br>Toegestaan is <br>A t/m Z <br>a t/m z <br>1 t/m 9 <br>en -"; } else { echo "geldige gebruikersnaam(goedgekeurd)"; } if(preg_match("/^[A-Za-z1-9-]{3,}$/", $_POST['wachtwoord']) && preg_match("/^[A-Za-z1-9-]{3,}$/", $_POST['herhaalwachtwoord'])) { if($_POST['wachtwoord'] != $_POST['herhaalwachtwoord']) { $error = $error+1; echo "niet hetzelfde wachtwoord"; } else { echo "hetzelfde wachtwoord (goedgekeurd)"; } } else { $error = $error+1; echo "wachtwoord moet minimaal 3 tekens bevatten!"; } if(!preg_match("/^[A-Za-z1-9_.-]{1,}@[A-Za-z1-9-]{1,}\.[A-Za-z1-9]{2,3}$/", $_POST['email'])) { $error = $error+1; echo "onjuiste email"; } else { echo "goedgekeurd!"; } if(!isset($error) { echo "goedgedaan geen errors!"; } } else { ?> <HTML> <HEAD> <TITLE>New Document</TITLE> </HEAD> <BODY> <form method="post"> <input type="text" name="gebruikersnaam" value="gebruikersnaam" maxlength="20" size="20"> <input type="password" name="wachtwoord" value="wachtwoord" maxlength="20" size="20"> <input type="password" name="herhaalwachtwoord" value="herhaalwachtwoord" maxlength="20" size="20"> <input type="text" name="email" value="[email protected]" maxlength="50" size="20"> <input type="submit" name="login" value="inloggen"> </form> </BODY> </HTML> <?php } ?> config(php) <?php $Minimale_Wachtwoord_Karakters = 3; ?> Link to comment https://forums.phpfreaks.com/topic/233726-little-problem-i-cant-fix-unexpected-in-aanmeldenphp-on-line-42/ Share on other sites More sharing options...
kenrbnsn Posted April 14, 2011 Share Posted April 14, 2011 You're missing a ")" on this line (line 41): <?php if(!isset($error) ?> it should be <?php if(!isset($error)) ?> Ken Link to comment https://forums.phpfreaks.com/topic/233726-little-problem-i-cant-fix-unexpected-in-aanmeldenphp-on-line-42/#findComment-1201597 Share on other sites More sharing options...
mrbean Posted April 14, 2011 Author Share Posted April 14, 2011 damn what am i stupid. didnt see that. i need to buy nerdy glasses. Link to comment https://forums.phpfreaks.com/topic/233726-little-problem-i-cant-fix-unexpected-in-aanmeldenphp-on-line-42/#findComment-1201615 Share on other sites More sharing options...
kenrbnsn Posted April 14, 2011 Share Posted April 14, 2011 Don't worry about it. I make the same mistake all the time... Ken Link to comment https://forums.phpfreaks.com/topic/233726-little-problem-i-cant-fix-unexpected-in-aanmeldenphp-on-line-42/#findComment-1201629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.