PhpNobody Posted July 12, 2011 Share Posted July 12, 2011 So I modified my code a bit and while running it is giving: Forbidden You don't have permission to access /main.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. This is the part that has the problem it seems: <? $map_query = mysql_query("SELECT * FROM user_map WHERE username='$session_username'"); while($map = mysql_fetch_array($map_query)){ $player[continent] = $map["continent"]; $player[xPos] = $map["xPos"]; $player[xLoc] = $map["xLoc"]; $player[xMap] = $map["xLoc"]; $player[yPos] = $map["yPos"]; $player[yLoc] = $map["yLoc"]; $player[yMap] = $map["yLoc"]; }; if (isset($_POST)){ $move[val] = @key($_POST["move"]); $move = $move[val]; $loc[num] = substr($move, 0, -1); $loc[let] = substr($move, -1); $ll = $loc[let].'Loc'; $lp = $loc[let].'Pos'; mysql_query("UPDATE user_map SET $ll='$player[$ll]'-'1', $lp='$player[$lp]-'1' WHERE id='$player[id]' AND username='$session_username'"); header("Location: ?p=map&view=local");} ?> What is wrong? Quote Link to comment https://forums.phpfreaks.com/topic/241844-whats-wrong/ Share on other sites More sharing options...
btherl Posted July 12, 2011 Share Posted July 12, 2011 That error is given by your webserver, and occurs before php execution, in that particular request anyway. It may be the result of this redirect though: header("Location: ?p=map&view=local"); The specification for Location headers says you must provide a full url, although most browsers will try to make a relative url like this work. You could try including the script name in the url, to make sure it goes to your script and not main.php Quote Link to comment https://forums.phpfreaks.com/topic/241844-whats-wrong/#findComment-1241976 Share on other sites More sharing options...
PhpNobody Posted July 13, 2011 Author Share Posted July 13, 2011 Turns out I missed one ' when inserting data into the database, still a weird error :S Quote Link to comment https://forums.phpfreaks.com/topic/241844-whats-wrong/#findComment-1242113 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.