Hello, I'm new to mccodes. I tried to clear existing player reports but keep getting this error message: Error: This script requires an action.
This is the code
function report_clear()
{
global $db, $ir, $c, $h, $userid;
if (!in_array($ir['user_level'], array(2, 3)))
{
echo 'You cannot access this area.<br />
> <a href="staff.php">Go Back</a>';
die($h->endpage());
}
staff_csrf_stdverify('staff_clear_preport',
'staff_users.php?action=reportsview');
$_POST['ID'] =
(isset($_POST['ID']) && is_numeric($_POST['ID']))
? abs(intval($_POST['ID'])) : 0;
if (empty($_POST['ID']))
{
echo '
Invalid ID, please go back and try again.
<br />
> <a href="staff_users.php?action=reportsview">Go Back</a>
';
die($h->endpage());
}
$d =
$db->query(
'SELECT COUNT(`prID`)
FROM `preports`
WHERE `prID` = ' . $_POST['ID']);
if ($db->fetch_single($d) == 0)
{
$db->free_result($d);
echo '
Report doesn\'t seem to exist, Please go back and try again.
<br />
> <a href="staff_users.php?action=reportsview">Go Back</a>
';
die($h->endpage());
}
$db->free_result($d);
$db->query(
'DELETE FROM `preports`
WHERE `prID` = ' . $_POST['ID']);
stafflog_add('Cleared player report ID ' . $_POST['ID']);
echo '
Report deleted.
<br />
> <a href="staff_users.php?action=reportsview">Go Back</a>
';
die($h->endpage());[/PHP]
Im using localhost
thanks