login  Naam:   Wachtwoord: 
Registreer je!
 Forum

activatie probleem

Offline Ultimatum - 15/11/2005 15:25 (laatste wijziging 15/11/2005 15:44)
Avatar van UltimatumPHP expert heb nu een script en die stuur activatiemail naar je toe om je mail te activeren  

maar returnt errors trug (die ik heb ingesteld )

let niet op mijn brak engels 

ik kom er echt niet uit, hoop dat jullie wel een fout(je) zien 

..::register.php::..
  1. $activationcode = CreateKey();
  2. $password = md5($_POST[password]);
  3. $select = "SELECT * FROM members";
  4. $query = mysql_query($select);
  5. $count = mysql_num_rows($query);
  6.  
  7. if($count == 0){
  8. $insert = "INSERT INTO leden (id, username, password, email, homepage, ip, activation, date, rank, subitle)
  9. VALUES ('', '" . $_POST['username'] . "', '" . $password . "', '" . $_POST[email] . "', '" . $_POST[homepage] . "', '" . $_SERVER[REMOTE_ADDR] . "', '" . $activationcode . "', NOW(), 'Beheerder', 'Beheerder')";
  10. $query = mysql_query($insert);
  11. }
  12. else {
  13. $insert = "INSERT INTO leden (id, username, password, email, homepage, ip, activation, date)
  14. VALUES ('', '" . $_POST['username'] . "', '" . $password . "', '" . $_POST[email] . "', '" . $_POST[homepage] . "', '" . $_SERVER[REMOTE_ADDR] . "', '" . $activationcode . "', NOW())";
  15. $query = mysql_query($insert);
  16. }
  17.  
  18. echo "You are succesfully signed up, please activate your account with the activationcode we've just send to your email address";
  19. mail("$_POST['email']", "Aanmelding activeren", "Hi $_POST['username'],
  20. Thank you for your registration on $site_name. To complete your registration, please click the link below.
  21.  
  22. $site_url/?page=users/activate&code=$activationcode
  23.  
  24. If you have not registert, just ignore this email and the account will be deleted in 48 hours
  25.  
  26. $webmaster,
  27. $site_url", "From: $site_name <$webmaster_email>\nReturn-path: $webmaster_email");


..::activate.php::..
  1. $select = "SELECT * FROM members WHERE activation='" . $_GET[code] . "' AND UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(date) < 48*60*60";
  2.  
  3. $query = mysql_query($select);
  4. $exist = mysql_num_rows($query);
  5. $list = mysql_fetch_array($query);
  6.  
  7. if($exist == 1 AND $list[activation] == $_GET[code] AND $list[activation] != 1){
  8. mysql_query("UPDATE members SET activation = '1' WHERE activation = '" . $_GET[code] . "'");
  9.  
  10. echo "Your account has been activated.";
  11.  
  12. }
  13. else {
  14. echo "There was an error by activating your account<br /><br />";
  15. echo "- Your account has already been activated<br />";
  16. echo "- Your activation code is not correct<br />";
  17. echo "- You didn't activated within 48 hours<br />";
  18. }
  19. ?>


..::mysql tabel::..
Citaat:
CREATE TABLE members (
id int(10) NOT NULL auto_increment,
username varchar(255) NOT NULL default '',
password varchar(255) NOT NULL default '',
email varchar(255) NOT NULL default '',
homepage varchar(255) NOT NULL default '',
ip varchar(15) NOT NULL default '',
activation int(10) NOT NULL default '0',
date datetime NOT NULL default '0000-00-00 00:00:00',
subtitle varchar(20) NOT NULL default 'Lid',
rank varchar(15) NOT NULL default 'Lid',
warnings int(1) NOT NULL default '0',
avatar varchar(50) NOT NULL default 'Geen',
PRIMARY KEY (id)
) TYPE=MyISAM;");


Citaat:
Rensjuh edit:
code verwijderd.
Zie regels 7.2.3:
voorzie het bericht eventueel van codefragmenten (géén lappen text)

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.251s