« Reply #15 on: April 04, 2012, 02:28:29 am »
Great tutorial, easy to understand!!!
I've read of another way to prevent this exploit by using in_array and then comparing against $_GET[''].
Example
<?php
$Redirection = array('View','Edit','Delete');
if(isset($_GET['Action']))
{
if(($_GET['Action'] == "View") && (in_array($_GET['Action'], $Redirection, TRUE)))
{
require("ViewRecord.php");
}
elseif(($_GET['Action'] == "Edit") && (in_array($_GET['Action'], $Redirection, TRUE)))
{
require("EditRecord.php");
}
elseif(($_GET['Action'] == "Delete") && (in_array($_GET['Action'], $Redirection, TRUE)))
{
require("DeleteRecord.php");
}
else
{
do something
}
}
else
{
require("index.php");
}
?>
I haven't tried to exploit it yet but I think it would work
Logged
The only people for me are the mad ones, the ones who are mad to live, mad to talk, mad to be saved, desirous of everything at the same time, the ones who never yawn or say a commonplace thing, but burn, burn, burn, like fabulous yellow roman candles exploding like spiders across the stars.
-Kerouac