Probleem in PHP code/database?

Gestart doorSemmiiee17 reacties17 weergaven

18 berichten · pagina 2 van 2

Semmiiee

Lid · Topicstarter

Berichten
4.013
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb al heel wat af van mijn registratie systeem, kijk maar: http://www.getclickmoney.nl/system/index.php, dan op Register klikken.

- Als passworden niet zelfde zijn komt er error dat wachtwoorden niet hetzelfde zijn.
- Maxlenght erbij gezet.
- Alle fields moeten ingevult worden

Normaal als je alles goed hebt ingevult moet er "Succes!!" komen te staan.
Maar als ik alles goed invul komt er te staan dan de wachtwoorden langer dan 6 tekens moet zijn.
Mijn wachtwoord was 8 tekens.

Register.php:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<h1>Register</h1>"[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$submit[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]];[/COLOR]

[COLOR= #0000BB]$fullname[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]fullname[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$repeatpassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/strip_tags"]strip_tags[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]repeatpassword[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$date[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Y-m-d"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$submit[/COLOR][COLOR= #007700])
{[/COLOR]

[COLOR= #FF8000]//check for existance[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$fullname[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]&&[/COLOR][COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700])
{[/COLOR]
    [COLOR= #FF8000]// encrypt password[/COLOR]
    [COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$repeatpassword[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700]);[/COLOR]
    
   [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700]==[/COLOR][COLOR= #0000BB]$repeatpassword[/COLOR][COLOR= #007700])
   {[/COLOR]
    [COLOR= #FF8000]//check char length of username and fullname[/COLOR]
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700]||[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$fullname[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700])
    {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Length of username of username is too long!"[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        
        [COLOR= #FF8000]//check password lenght[/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700])>[/COLOR][COLOR= #0000BB]25[/COLOR][COLOR= #007700]||[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR][COLOR= #007700])<[/COLOR][COLOR= #0000BB]6[/COLOR][COLOR= #007700])
        {[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Password must be between 6 and 25 characters!"[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
           [COLOR= #FF8000]//register the user![/COLOR]
           
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Succes!!"[/COLOR][COLOR= #007700];
            
        }
    }
    
    
   }[/COLOR]
   [URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Your passwords do not match!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Please full in <b>all</b> fields!"[/COLOR][COLOR= #007700];


 
  
}[/COLOR]
?>

<html>
<p>
<form action="register.php" method="POST">
    <table>
        <tr>
            <td>
            Your full name:
        </td>
        <td>
        <input type="text" name="fullname">
        </td>
        </tr>
    <tr>
            <td>
            Choose a username:
        </td>
        <td>
        <input type="text" name="username">
        </td>
        
        </tr>
        <tr>
            <td>
            Choose a password:
        </td>
        <td>
        <input type="password" name="password">
        </td>
        </tr>
          <tr>
            <td>
            Repeat your password:
        </td>
        <td>
        <input type="password" name="repeatpassword">
        </td>
        </tr>
     </table>
       <p>
    <input type="submit" name="submit" value="Register">
    </p>


</form>

</html>
0
Berichten
9.953
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Omg, en jij noemt Smiegles noob, terwijl je zelf niet eens kleine foutjes op kan lossen.
0
Semmiiee

Lid · Topicstarter

Berichten
4.013
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sebastiaanh schreef:
Omg, en jij noemt Smiegles noob, terwijl je zelf niet eens kleine foutjes op kan lossen.
Ik noem smiegles niet noob.
Ik vind zijn tuts alleen dom. Hij is veel beter dan mij in php en ik heb het nu wel allang af mijn registratie systeem en inlog systeem. smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren