Als er iemand zich aanmeld begin id niet met 1

Gestart doorBoude4 reacties24 weergaven

5 berichten · pagina 1 van 1

Boude

Lid · Topicstarter

Berichten
2.837
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Als er iemand op imjn site zich aanmeld begint hij niet te tellen met id bij 1 maar bij 52 confused.. Hoe zo ik dat op kunnen lossen?

Aanmelden:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"<br><br>"[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$user[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ref[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]){[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Geen username ingevuld!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])
{[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Geen wachtwoord ingevuld!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/elseif"]elseif[/URL][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/echo"]echo[/URL][COLOR= #DD0000]"Geen emailadres ingevuld!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
      [COLOR= #0000BB]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"select * from users where username=$_POST[user]"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$row[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_Array"]mysql_fetch_Array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700])) {[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Gebruikersnaam is in gebruik, kies een andere!"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
      [COLOR= #0000BB]$code[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]);[/COLOR]
      [COLOR= #0000BB]$userreg[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]];[/COLOR]
      [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO users (username, email, saldo, pass, button, active, code) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", 100, "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$code[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]", , 0, "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$code[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/print"]print[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
      [COLOR= #0000BB]$van[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"$webmaster_email"[/COLOR][COLOR= #007700];[/COLOR]
      [COLOR= #0000BB]$to[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]];[/COLOR]
      [COLOR= #0000BB]$ow[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Account activeren"[/COLOR][COLOR= #007700];[/COLOR]
      [COLOR= #0000BB]$inh[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Hallo.
Je hebt je aangemeld op $siteurl.

Klik op onderstaande link om je account te activeren:
$siteurl"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"activeer.php?code=$code&user=$userreg"[/COLOR][COLOR= #007700];[/COLOR]
      [COLOR= #0000BB]$success[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mail"]mail[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$to[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$ow[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$inh[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"From: <$van>"[/COLOR][COLOR= #007700]);[/COLOR]
      [COLOR= #0000BB]$query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `users` SET saldo=saldo+$refextra WHERE `username` = $user"[/COLOR][COLOR= #007700]);[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"Succesvol aangemeld!<br>Controleer je email voor de activatielink."[/COLOR][COLOR= #007700];
      }
    }
  }[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>    </p>
    <form name="form1" method="post" action="">
  <font size="2" face="Verdana, Arial, Helvetica, sans-serif"> Gebruikersnaam:<br>
  <input name="user" type="text" id="user">
  <br>
  Wachtwoord:<br>
  <input name="pass" type="password" id="pass">
  <br>
  Emailadres:<br>
  <input name="email" type="text" id="email">
  <br>
  <input type="submit" name="Submit" value="Aanmelden &gt;&gt;">
  </font> 
</form>
[COLOR= #0000BB]<?[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Remi

Lid

Berichten
1.270
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan zijn er ooit al 52 accounts aangemaakt en die later weer verwijderd (denk ik)
Je zou id uit je database kunnen verwijderen en opnieuw aanmaken met deze sql:

ALTER TABLE `users` ADD `id` int(11) auto_increment primary key


Als je je dan registreert heb je als het goed is id 1
0
Boude

Lid · Topicstarter

Berichten
2.837
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
CREATE TABLE `users` (
`id` bigint(255) unsigned NOT NULL auto_increment,
`username` varchar(255) default NULL,
`email` varchar(255) default NULL,
`saldo` int(11) default 0,
`pass` varchar(255) default NULL,
`button` longtext NOT NULL,
`active` longtext NOT NULL,
`code` longtext NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=52 ;

Dat is mij sql zo jij die effe kunnen veranderen voor me?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
CREATE TABLE `users` (
`id` bigint(255) unsigned NOT NULL auto_increment,
`username` varchar(255) default NULL,
`email` varchar(255) default NULL,
`saldo` int(11) default 0,
`pass` varchar(255) default NULL,
`button` longtext NOT NULL,
`active` longtext NOT NULL,
`code` longtext NOT NULL,
PRIMARY KEY (`id`),
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Als je eventjes had gekeken lag het aan:
AUTO_INCREMENT=52 ;
0
Boude

Lid · Topicstarter

Berichten
2.837
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thx sorry had het niet gezien bloos..
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