gamer dude   10 #1 Posted July 23, 2010 Hello,  Iv done everything i can think but it's still not working,  The Prob is when someone sign-up it says "Your account has been created successfully!" and and then when you try to login it keeps saying "Name and password not found or not matched"   Have a look http://www.pro-gamer.me/test Share this post Link to post Share on other sites Share this content via...
Ghozer   113 #2 Posted July 23, 2010 we will need to see the code you use to set the name and password in the database, then what you use to check and compare them  if your encrypting the password using md5() (in php for example) you will then need to encrypt the submitted one when the user logs in, and compare the two results (the one in the database, and the result of the submitted password)  Show us your code, and we'll be able to go from there... Share this post Link to post Share on other sites Share this content via...
gamer dude   10 #3 Posted July 23, 2010 From Database? my database is mysql  If not this is some of it from my php file Register.php  //insert the values if (!isset($message)){ $result= mysql_query("INSERT INTO `grpgusers` (ip, username, password, email, signuptime, lastactive)". "VALUES ('".$_SERVER['REMOTE_ADDR']."', '$username', '$password', '$email', '$signuptime', '$signuptime')"); echo Message('Your account has been created successfully! Redirecting to login page in 5 seconds. <meta http-equiv="refresh" content="5;url=login.php">');  if ($_POST['referer'] != ""){ $result= mysql_query("INSERT INTO `referrals` (`when`, `referrer`, `referred`)". "VALUES ('$signuptime', '".$_POST['referer']."', '".$username."')"); }  die(); } } Share this post Link to post Share on other sites Share this content via...
Cyclone   10 #4 Posted July 23, 2010 And the code that processes the login?  Have you had a look at the database directly to see that the values have inserted as you expected?  start a mysql command line interface  use name_of_your_database;  select * from grpgusers; Share this post Link to post Share on other sites Share this content via...
gamer dude   10 #5 Posted July 23, 2010 here ill upload the register.php and login.php for you to look at. http://rapidshare.com/files/408565749/Login___Register_php.rar Share this post Link to post Share on other sites Share this content via...
gamer dude   10 #6 Posted July 23, 2010 well?? do you know what wrong? Share this post Link to post Share on other sites Share this content via...
Ghozer   113 #7 Posted July 23, 2010 we need to see whats in $password, i'll take a look at your RAR file later, but I have an appointment to get to now.. Share this post Link to post Share on other sites Share this content via...
Cyclone   10 #8 Posted July 23, 2010 well?? do you know what wrong?  Did you have a look at the database to see what had been inserted into the table? Share this post Link to post Share on other sites Share this content via...
denomis   10 #9 Posted July 23, 2010 why are you just remaking mobwars from facebook ? Share this post Link to post Share on other sites Share this content via...
Cyclone   10 #10 Posted July 23, 2010 I don't program in php, but logically it looks correct.  There's several things you can do, firstly do as I suggested and check what (if anything) is being inserted into the db when you do a test registration. Secondly, for development purposes put some more verbose output in when a login fails. For example instead of just outputting that the username and password combination was wrong, output whether the username query returned anything, and if it did return something, output both the password stored in that object and the password you were comparing it to. Share this post Link to post Share on other sites Share this content via...
gamer dude   10 #11 Posted July 23, 2010 Here is some of the table structer for the database. -- Table structure for table `grpgusers` --  CREATE TABLE `grpgusers` ( `id` int(10) NOT NULL auto_increment, `username` varchar(75) NOT NULL default '0', `password` varchar(75) NOT NULL default '0', `exp` int(30) NOT NULL default '0', `money` int(30) NOT NULL default '1000', `bank` int(30) NOT NULL default '0', `whichbank` int(2) NOT NULL default '0', `hp` int(10) NOT NULL default '50', `energy` int(10) NOT NULL default '10', `nerve` int(10) NOT NULL default '5', `workexp` int(10) NOT NULL default '0', `strength` int(10) NOT NULL default '10', `defense` int(10) NOT NULL default '10', `speed` int(10) NOT NULL default '10', `battlewon` int(10) NOT NULL default '0', `battlelost` int(10) NOT NULL default '0', `battlemoney` int(20) NOT NULL default '0', `crimesucceeded` int(10) NOT NULL default '0', `crimefailed` int(10) NOT NULL default '0', `crimemoney` int(20) NOT NULL default '0', `points` bigint(20) NOT NULL default '0', `rmdays` tinyint(5) NOT NULL default '0', `signuptime` int(20) NOT NULL default '0', `lastactive` int(20) NOT NULL default '0', `awake` int(5) NOT NULL default '100', `email` varchar(75) NOT NULL default '', `jail` int(1) NOT NULL default '0', `hospital` int(1) NOT NULL default '0', `hwho` varchar(30) NOT NULL, `hwhen` varchar(30) NOT NULL, `hhow` varchar(30) NOT NULL, `house` int(3) NOT NULL default '0', `gang` int(10) NOT NULL default '0', `quote` text NOT NULL, `avatar` varchar(50) NOT NULL, `city` int(3) NOT NULL default '1', `admin` int(1) NOT NULL default '0', `searchdowntown` int(3) NOT NULL default '100', `job` int(5) NOT NULL, `ip` int(20) NOT NULL, `eqweapon` int(20) NOT NULL, `eqarmor` int(20) NOT NULL, `potseeds` int(20) NOT NULL, `marijuana` int(20) NOT NULL, `cocaine` int(20) NOT NULL, `style` int(3) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=98 ;  -- -------------------------------------------------------- Share this post Link to post Share on other sites Share this content via...
Ghozer   113 #12 Posted July 23, 2010 we dont need the structure, we need to know whats IN the database now...  looking at this (`password` varchar(75)) the password isn't encrypted @ the database side, so i'm assuming it will be in the script... i'll take a look at your RAR now... Share this post Link to post Share on other sites Share this content via...