Bir çalışmamdan örnek bir kısım:
if (isset($_GET['delete']))
{
$id_page = (int) $_GET['delete'];
mysql_query("
DELETE FROM {$db_prefix}pages
WHERE id_page = $id_page");
redirectexit('admin/index.php?action=pages');
}
if (isset($_GET['move']) && ($_GET['direction'] == 'up' || $_GET['direction'] == 'down'))
{
$id_page = (int) $_GET['move'];
$direction = $_GET['direction'];
fixMenuOrdering($id_page, $direction);
redirectexit('admin/index.php?action=pages');
}
if (isset($_GET['status']))
{
$id_page = (int) $_GET['status'];
$request = mysql_query("
SELECT status
FROM {$db_prefix}pages
WHERE id_page = $id_page");
list ($status) = mysql_fetch_row($request);
mysql_free_result($request);
$new_status = $status ? 0 : 1;
mysql_query("
UPDATE {$db_prefix}pages
SET status = $new_status
WHERE id_page = $id_page");
redirectexit('admin/index.php?action=pages');
}
// Verileri listelediğim kısım...redirectexit fonksiyonu:
function redirectexit($setLocation = '', $refresh = false)
{
global $scripturl;
$add = preg_match('~^(ftp|http)[s]?://~', $setLocation) == 0;
if ($add)
$setLocation = $scripturl . ($setLocation != '' ? (substr($setLocation, 0, 1) != '?' ? '' : '?') . $setLocation : '');
if ($refresh !== false)
echo '<meta http-equiv="refresh" content="' . $refresh . ';url=' . $setLocation . '" />';
else
header('Location: ' . str_replace(' ', '%20', $setLocation));
}