katarra Posted March 5, 2010 Author Share Posted March 5, 2010 Well, evidently the query isn't running correctly then... Hmm... "No rows returned0" Well, crap. if I capitalize it "Zelig", it shows up "15" on the screen. Stupid case-sensitivity... *laughs* Quote Link to comment https://forums.phpfreaks.com/topic/194180-php-coding-error-help/page/2/#findComment-1022094 Share on other sites More sharing options...
katarra Posted March 5, 2010 Author Share Posted March 5, 2010 Now how do I make it so that it will automatically search for the person that is currently logged in? "Zelig" will work for my character, but say someone else logs in and runs the script. How can I program it so that it recognizes character "Asher" instead of "Zelig" and uses their energy stat? Quote Link to comment https://forums.phpfreaks.com/topic/194180-php-coding-error-help/page/2/#findComment-1022095 Share on other sites More sharing options...
mikesta707 Posted March 5, 2010 Share Posted March 5, 2010 how does your login script work? You mentioned not using cookies. does that mean you use sessions? I would need this information to give a concrete answer Quote Link to comment https://forums.phpfreaks.com/topic/194180-php-coding-error-help/page/2/#findComment-1022097 Share on other sites More sharing options...
katarra Posted March 5, 2010 Author Share Posted March 5, 2010 The top of the page: <html> <head> <title>The Worlds of Katarra</title> <link rel=stylesheet type=text/css href=style.css> <script language="javascript" type="text/javascript"> setTimeout( function() { var mytext = document.getElementById("rptext"); mytext.focus(); mytext.select(); } , 1); </script> </head> Login Script: $loginname = ucwords(strtolower($loginname)); if ($loginname == " ") die("You didn't enter your username. Please go back and do so, or create a new character <a href=\"index1.html?page=register\">here</a>.<br>\n"); if (!isuser($loginname)) die("That username does not exist. To create it, click <a href=\"index1.html?page=register?username=$loginname\">here</a>.<br>"); $username = $loginname; $encrypted = md5($loginpass); if (get("password") !== md5(md5($loginpass))) die("Incorrect password.<br>\n"); addlogin($loginname,$loginpass,$REMOTE_ADDR); if(!is_numeric(get("admin"))){ $timelog=getfile("timelog"); $timelog.="$loginname:in:".time()."\n"; setfile("timelog",$timelog); } $asdf = 0; $charsdata = getfile("online"); if (strpos($charsdata,"$loginname:") !== false) $asdf = 1; $charsdata = str_replace("$loginname:","",$charsdata)."$loginname:"; setfile("online",$charsdata); $framesize = get("frame"); $encrypted = md5($loginpass); echo "<frameset rows=\"".$framesize."%,*,0\" border=0>\n<frame name=\"TOP\" "; if ($asdf == 1){ echo "src=\"main.php?username=$loginname&password=$encrypted\""; }else{ echo "src=\"main.php?username=$loginname&password=$encrypted&isloggingin=1\""; } echo " noresize>\n<frame name=\"BOTTOM\" src=\"command.php?x=$loginname&y=$encrypted\" noresize scrolling=no>\n<frame name=CHECKER src=chatchek.php?username=$loginname&password=$encrypted noresize></frameset>\n"; set("lasttell",""); Quote Link to comment https://forums.phpfreaks.com/topic/194180-php-coding-error-help/page/2/#findComment-1022102 Share on other sites More sharing options...
mikesta707 Posted March 5, 2010 Share Posted March 5, 2010 seems to me that the username of the current user is stored in the get variable $_GET['username']. try that. you have a very strange way of handling log ins by the way. perhaps you should look into sessions Quote Link to comment https://forums.phpfreaks.com/topic/194180-php-coding-error-help/page/2/#findComment-1022116 Share on other sites More sharing options...
katarra Posted March 7, 2010 Author Share Posted March 7, 2010 I'll definitely look into sessions or something else after this! *laughs* I don't quite understand where to put the get variable at in my script... Quote Link to comment https://forums.phpfreaks.com/topic/194180-php-coding-error-help/page/2/#findComment-1022558 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.