na registreren een error

Gestart doorDesire5 reacties43 weergaven

6 berichten · pagina 1 van 1

Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik was bezig met het eeros systeem, maar ik heb echt niks in registeren.php gedaan, en toch komt er een error, namelijk deze:

Quote:
Deprecated: Function eregi() is deprecated in /home/gebruiker/domains/site/public_html/MAP/pagina/registreren.php on line 81

Het registeren werkt helemaal, alleen komt die error na de registratie.

Wat kan de fout zijn?

Hier is de code.

[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #FF8000]/**
 * @copyright   2010 Milan Drossaerts
 * @author      Milan Drossaerts [http://www.dynaspan-media.nl]
 * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
 *              Redistribution and use in source and binary forms, with or without
 *              modification, are permitted provided that the following conditions
 *              are met:
 *  
 *              * Redistributions of source code must retain the above copyright
 *                notice and this (list of) condition(s).
 */[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$leden[/COLOR][COLOR= #007700]->[/COLOR]is_ingelogd[COLOR= #007700]())
{[/COLOR]
    
    [COLOR= #0000BB]$layout[/COLOR][COLOR= #007700]->[/COLOR]boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Je bent al ingelogd[/COLOR][COLOR= #007700]);[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je bent al aangemeld, je hoeft geen nieuw account te maken.[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$layout[/COLOR][COLOR= #007700]->[/COLOR]onder[COLOR= #007700]();
    
}[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
    
    [COLOR= #0000BB]$layout[/COLOR][COLOR= #007700]->[/COLOR]boven[COLOR= #007700]([/COLOR][COLOR= #DD0000]Registreren[/COLOR][COLOR= #007700]);[/COLOR]
    
    [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]]))
    {[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]))
        {[/COLOR]
            
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een gebruikersnaam in.[/COLOR][COLOR= #007700]);
            
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]) >[/COLOR] [COLOR= #0000BB]10[/COLOR][COLOR= #007700])
            {[/COLOR]
                
                [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een gebruikersnaam in die kleiner is dan 10 tekens[/COLOR][COLOR= #007700]);
                
            }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
            
                [COLOR= #0000BB]$gcQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT 1 FROM leden WHERE gebruikersnaam = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
            
                [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]num_rows[COLOR= #007700]([/COLOR][COLOR= #0000BB]$gcQuery[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
                {[/COLOR]
                
                    [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Er bestaat al een gebruiker met deze gebruikersnaam.[/COLOR][COLOR= #007700]);
                
                }
            
            }
            
        }[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ww[/COLOR][COLOR= #007700]]))
        {[/COLOR]
            
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een wachtwoord in.[/COLOR][COLOR= #007700]);
            
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
            
            [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ww[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ww1[/COLOR][COLOR= #007700]])
            {[/COLOR]
                
                [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]De wachtwoorden zijn niet gelijk.[/COLOR][COLOR= #007700]);
                
            }
            
        }[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]))
        {[/COLOR]
            
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een email adres in.[/COLOR][COLOR= #007700]);
            
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
            
            [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/eregi"]eregi[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]))
            {[/COLOR]
                
                [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Vul een geldig email adres in.[/COLOR][COLOR= #007700]);
                
            }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
                
                [COLOR= #0000BB]$ecQuery[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT 1 FROM leden WHERE email = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
                
                [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]num_rows[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ecQuery[/COLOR][COLOR= #007700]) !=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
                {[/COLOR]
                    
                    [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]add_fout[COLOR= #007700]([/COLOR][COLOR= #DD0000]Er bestaat al een lid met dit email adres.[/COLOR][COLOR= #007700]);
                    
                }
                
            }
            
        }[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]aantal_fouten[COLOR= #007700]() ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [COLOR= #0000BB]$activatiecode[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mt_rand"]mt_rand[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]1111[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]9999[/COLOR][COLOR= #007700]));[/COLOR]
            
            [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO leden (gebruikersnaam, wachtwoord, email, geactiveerd, activatiecode) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ww[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", 0, "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$activatiecode[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
            
            [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]Account activeren | [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_CONFIG[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Site_naam[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]Hoi [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]
Je ontvangt hierbij je activatie code
Ga naar deze link:
[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_CONFIG[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Site_url[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]?p=activeren&gebruiker=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]gebruikersnaam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]&c=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$activatiecode[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]From: [/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_CONFIG[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Site_naam[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000] <[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_CONFIG[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Site_email[/COLOR][COLOR= #007700]] .[/COLOR] [COLOR= #DD0000]>[/COLOR][COLOR= #007700]);[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Je account is aangemaakt. Je hebt een email ontvangen om je account te activeren.[/COLOR][COLOR= #007700];
            
        }[/COLOR][URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]De volgende fouten zijn opgetreden tijdens je registratie:<br />[/COLOR][COLOR= #007700];[/COLOR]
            
            [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]weergeef_fouten[COLOR= #007700]();
            
        }
        
    }[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<form action="" method="post">
    <table>
      <tr>
        <td style="width: 300px;">Gebruikersnaam:</td>
        <td style="width: 300px;"><input type="text" name="gebruikersnaam" /></td>
      </tr>
      <tr>
        <td style="width: 300px;">Wachtwoord:</td>
        <td style="width: 300px;"><input type="password" name="ww" /></td>
      </tr>
      <tr>
        <td style="width: 300px;">Wachtwoord<small>(herhaling)</small>:</td>
        <td style="width: 300px;"><input type="password" name="ww1" /></td>
      </tr>
      <tr>
        <td style="width: 300px;">Email <small>Alleen voor activatie</small>:</td>
        <td style="width: 300px;"><input type="text" name="email" /></td>
      </tr>
      <tr>
        <td style="width: 300px;"></td>
        <td style="width: 300px;"><input type="submit" name="submit" value="Registreren" /></td>
      </tr>
    </table>
    </form>[/COLOR][COLOR= #007700];[/COLOR]
    
    [COLOR= #0000BB]$layout[/COLOR][COLOR= #007700]->[/COLOR]onder[COLOR= #007700]();
    
}[/COLOR]

?>


Mvg,
Desire
0
Berichten
6.201
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Script even ombouwen met preg_match() wink
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
en je reguliere expressie aanpassen met een delimiter..
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb nu in plaats van eregi, preg_match gedaan, maar waar moet delimiter.

toevoeging op 7 mei 2012, 13:30:51:
Het werkt, heb nu ditsmile
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"#^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$#"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]))[/COLOR]
?>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Voor en achter... Maar dat heb je al opgelost zo te zien smile
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Voor en achter... Maar dat heb je al opgelost zo te zien smile
Jep, eindelijk krijg ik een beetje verstand van PHPsmile
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