Jump to content
MakeWebGames

having problems with login page rc engine


xRudeboiix

Recommended Posts

my friend has just recently told me to help him build his game but neither of us can figure this one problem out..

problem: once you go on the game and type password and username and click login it will return back to the login page.

any help would be nice thanks :)

Edited by xRudeboiix
Link to comment
Share on other sites

Right well I'm not 100% sure where your problem is actually coming from, but if its taking you straight back the home after you click the login button maybe its something to do with this bit of code:

 

if($_SERVER['HTTP_REFERER'] != 'http://www.dangerouscity.com/home.php' && $_SERVER['HTTP_REFERER'] != 'http://dangerouscity.com/home.php') 
   {
       header("location:home.php");
   }
   else
   {

 

from your authent.php file.

right, somewhat unrelated but could be a bit of helpful advice. NEVER use tables simply to style the page, your wasting resources. its not needed, especially with CSS which you should be utilizing, especially for speed sake. another thing, i would personally put the

$pass = $_POST['pass'];

 

then do your security stuff outside your mysql query.

Another thing, use mysqli because mysql is or will very soon be deprecated.

one other thing, im not 100% sure about but:

$granted = mysql_query("SELECT `playerid`,`playername` FROM `members` WHERE 
   `player_login_name` = '".mysql_real_escape_string($_POST['name'])."' &&
   `player_login_pass` = '".mysql_real_escape_string(md5($_POST['pass']))."'"); 

 

do the quotes clash at this part? :

 

   `player_login_name` = '".mysql_real_escape_string($_POST['name'])."' &&
   `player_login_pass` = '".mysql_real_escape_string(md5($_POST['pass']))."'"); 

 

one last thing :

$granted = mysqil_query($c, "SELECT `playerid`,`playername` FROM `members` WHERE 
   `player_login_name` = '".mysql_real_escape_string($_POST['name'])."' AND
   `player_login_pass` = '".mysql_real_escape_string(md5($_POST['pass']))."'"); 

that should work if you use mysqli.

dont know how helpful that is, but it should be something to think about.

And this is completely unrelated, but your code is ugly. split the register and login into two different files, your file seems cluttered because of the functions, if you must you can keep the functions, just use

include 'file.php';

 

- - - Updated - - -

rudeboixx you seem a bit inexperienced, where did you learn how to code your login and authent file?

Link to comment
Share on other sites

rudeboiix, i was looking through other posts you have put on this site. You look like you've jumped in at the deep and are drowning badly. Very badly, fro one, you don't seem to know how to use a server properly, and you look like you have no SQL knowledge or even PHP knowledge for that matter.

Do yourself a favour, google how to code in html, then in css, next php.

You always seem to look for the quick fix, you need to learn whats wrong, why its wrong, and steps to fix it. It's the only way to get good at programming, and run a good game. You cant run a game if your constantly running to others to fix your games problems, and you definitely wont get a userbase.

Link to comment
Share on other sites

Don't blame your mate for the errors. you dont have the knowledge to fix it, so why cant this elusive "mate" of yours sort out the problems he created?

mean that in the least hurtful way possible, i just think you need to learn to code if your going to try and make a game.

honestly if you need proper help with your files then i'm open to helping you, for free, you'll just have to understand that i cant be dedicated, and i would need to see the files, but if your mate coded everything he should be able to fix it all

If you've found out the problem mind sharing it so that we can benefit as well?

Edited by Coly010
Link to comment
Share on other sites

  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...