Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

PHP 

[help] Need a guide on how to make a secure admin section

You should mysql_real_escape_string the values before trying to check them from the db.
Perhaps:

Code
<?php
include("lib.php");
$player = check_user($secret_key, $db);
if($player->rank != "Administrador")
{
header("Location: personagem.php");
exit;
}
include("templates/private_header.php");
head("Admin Panel","adminpanel.png");
startbox();
if(isset($_GET['page']))
{
include("admin/" . $_GET['page'] . ".php");
}
else
{
?>
<A href="admin.php?page=code1">Kill Players</a><br>
<A href="admin.php?page=code2">Heal Players</a><br>

<?php
}
endbox();
include("templates/footer.php");
?>
i want to know if im prone to hacking. the code1.php and code2.php uses a custom query library that is included in lib.php so there is no way to execute them directly without falling in to an error.

Also in My template i have:

if($player->rank == "Administrador")
{
echo "<a href='admin.php'>Admin Panel</a>";
}

Taken from:
http://stackoverflow.com/questions/66500...ation-page
you could encrypt the data that is being transferred from client to server or other way around..


Possibly Related Threads...
Thread / Author Replies Views Last Post
[PHP] by Internet SecurityDec 27, 2014 08:28 AM 11 518 Dec 27, 2014 08:28 AM
Last Post: Internet Security
[PHP] by Webman.ioFeb 17, 2012 07:48 AM 5 150 Feb 17, 2012 07:48 AM
Last Post: Uncomplicated
[PHP] by -"h3l1m@n"-Oct 20, 2011 04:40 PM 15 139 Oct 20, 2011 04:40 PM
Last Post: Miraculous