Jump to content

My Online Game (Database Help)

Recommended Posts

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

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

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

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

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
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

why are you just remaking mobwars from facebook ?

Share this post


Link to post
Share on other sites

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.