TAGS :Viewed: 12 - Published at: a few seconds ago

[ Random (almost) redirecting to index when $_GET data is involved? ]

Im currently constructing a control panel for controlling minecraft servers, the problem im facing is that when i try and access 'overview.php', with a tag HRef'ing to "overview.php/?id=", Key being the integer in a table i want to access for usage on the overview page.

The problem i face is that, when i have overview.php in my URL bar its fine. But when its followed by a '/' (so overview.php/) to follow with a "?id=0" for example, it displays partially the data found on the index page of the login area. The only point in the code this page is referenced to is at the start of the page, where it checks if the user is logged in and if not redirects them to login.

Heres the PHP code on overview.php:

    header("Location: ../index.php"); 

    die("Redirecting to ../index.php"); 
    $usr = $_SESSION['user'];   
    $ips = $usr["ip"];
    $ports = $usr["port"];
    $rcons = $usr["rcon"];

    $a_ip = explode(",",$ips);
    $a_port = explode(",",$ports);
    $a_rcon = explode(",",$rcons);

Answer 1

You are not supposed to follow overview.php with /.

overview.php/?id=0 is incorrect.

overview.php?id=0 is correct.