Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/241844-whats-wrong/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/241844-whats-wrong/#findComment-1241976
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

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

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.