Jump to content

Little problem i cant fix (unexpected '{' in aanmelden.php on line 42)


mrbean

Recommended Posts

Its an easy script

But im not smart :confused: enough to fix it  :wtf:

 

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="voorbeeld@domeinnaam.extensie" 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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.