xRudeboiix Posted December 14, 2013 Share Posted December 14, 2013 (edited) 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 December 14, 2013 by xRudeboiix Quote Link to comment Share on other sites More sharing options...
Seker Posted December 14, 2013 Share Posted December 14, 2013 Some code maybe? Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted December 14, 2013 Share Posted December 14, 2013 yes please more help for us to help you. there could be a few problems like your form, authentication error, or more Quote Link to comment Share on other sites More sharing options...
xRudeboiix Posted December 14, 2013 Author Share Posted December 14, 2013 code of what? there is no message that appears it just refreshes to the same page, it dont go past the login page Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted December 14, 2013 Share Posted December 14, 2013 grab the code from both your login.php file and your authenticate.php file and past the code dealing with the login details here. It's hard to diagnose your problem with no view of the code causing it! Quote Link to comment Share on other sites More sharing options...
xRudeboiix Posted December 14, 2013 Author Share Posted December 14, 2013 (edited) fixeddddddddddd Edited December 14, 2013 by xRudeboiix Quote Link to comment Share on other sites More sharing options...
Dominion Posted December 14, 2013 Share Posted December 14, 2013 code of what? there is no message that appears it just refreshes to the same page, it dont go past the login page Is error reporting on? Quote Link to comment Share on other sites More sharing options...
xRudeboiix Posted December 14, 2013 Author Share Posted December 14, 2013 no what is it Quote Link to comment Share on other sites More sharing options...
Coly010 Posted December 14, 2013 Share Posted December 14, 2013 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? Quote Link to comment Share on other sites More sharing options...
Coly010 Posted December 14, 2013 Share Posted December 14, 2013 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. Quote Link to comment Share on other sites More sharing options...
xRudeboiix Posted December 14, 2013 Author Share Posted December 14, 2013 thanks and its cos ma mate coded it Quote Link to comment Share on other sites More sharing options...
Coly010 Posted December 14, 2013 Share Posted December 14, 2013 (edited) 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 December 15, 2013 by Coly010 Quote Link to comment Share on other sites More sharing options...
Seker Posted December 14, 2013 Share Posted December 14, 2013 If you've found out the problem mind sharing it so that we can benefit as well? Your posts are starting to be as annoying as his. Heard of the "Edit" button? Quote Link to comment Share on other sites More sharing options...
spikereloaded Posted December 14, 2013 Share Posted December 14, 2013 ...slightly excessive Quote Link to comment Share on other sites More sharing options...
Coly010 Posted December 15, 2013 Share Posted December 15, 2013 happy? sheesh.... Quote Link to comment Share on other sites More sharing options...
jcvenom Posted December 17, 2013 Share Posted December 17, 2013 The problem here is that you have a bad checking method for posting also you need to escape user data thats being posted using mysql_real_escape_string() Quote Link to comment Share on other sites More sharing options...
Legaci Posted January 11, 2014 Share Posted January 11, 2014 making sure form action='authentication.php' with out that it wouldnt divert to this file Quote Link to comment Share on other sites More sharing options...
Uridium Posted January 16, 2014 Share Posted January 16, 2014 from my knowledge of RC there were numerous places in some scripts your actual URl had to be added... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.