Код: Выделить всё
Warning: Cannot modify header information - headers already sent by (output started at /home/k/index.php:30) in /home/k/index.php on line 134
<?
exit;
}
switch (@$_GET['d'])
{
case "add":
if (empty($_POST['url']))
break;
if (isset($_POST['country'])) $_POST['country'] = strtoupper($_POST['country']);
$sql = "INSERT INTO `files`
(`url`, `dnum`, `country`)
VALUES
('{$_POST['url']}', '".intval($_POST['dnum'])."', '{$_POST['country']}')
";
mysql_query($sql);
header ("location: index.php");
break;
case "del":
if (!isset($_GET['id']))
break;
$sql = "DELETE FROM `files` WHERE `id`='{$_GET['id']}'";
mysql_query($sql);
header ("location: index.php");
break;
}
if (isset($_POST['opt']))
{
if (!isset($_POST['opt']['spoof_ip']))
$_POST['opt']['spoof_ip'] = 0;
foreach (array_keys($_POST['opt']) as $k)
mysql_query("REPLACE INTO `opt` (`name`, `value`) VALUES ('$k', '{$_POST['opt'][$k]}')");
134: header("location: index.php");
}
$bopt = array();
$r = mysql_query("SELECT * FROM `opt`");
while ($f = mysql_fetch_array($r))
$bopt[$f['name']] = $f['value'];
?>
exit;
}
switch (@$_GET['d'])
{
case "add":
if (empty($_POST['url']))
break;
if (isset($_POST['country'])) $_POST['country'] = strtoupper($_POST['country']);
$sql = "INSERT INTO `files`
(`url`, `dnum`, `country`)
VALUES
('{$_POST['url']}', '".intval($_POST['dnum'])."', '{$_POST['country']}')
";
mysql_query($sql);
header ("location: index.php");
break;
case "del":
if (!isset($_GET['id']))
break;
$sql = "DELETE FROM `files` WHERE `id`='{$_GET['id']}'";
mysql_query($sql);
header ("location: index.php");
break;
}
if (isset($_POST['opt']))
{
if (!isset($_POST['opt']['spoof_ip']))
$_POST['opt']['spoof_ip'] = 0;
foreach (array_keys($_POST['opt']) as $k)
mysql_query("REPLACE INTO `opt` (`name`, `value`) VALUES ('$k', '{$_POST['opt'][$k]}')");
134: header("location: index.php");
}
$bopt = array();
$r = mysql_query("SELECT * FROM `opt`");
while ($f = mysql_fetch_array($r))
$bopt[$f['name']] = $f['value'];
?>