View Single Post
  #5  
Old 3rd August 2008, 11:58
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
setfreeleech.php

PHP Code:
<?
require "include/bittorrent.php";
dbconn();
loggedinorreturn();

if (
get_user_class() < UC_SYSOP)
stderr("Error""Access denied.");

if (
$HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
{
if (
$HTTP_POST_VARS["isfree"] == "")
stderr("Error""Missing form data.");
$isfree=$HTTP_POST_VARS["isfree"];
if(
$isfree == "no")
$setfree "no";
elseif(
$isfree == "yes")
$setfree "yes";
else
stderr("Error""Please choose if free or not free!");
        
mysql_query("UPDATE torrents SET free=".sqlesc($setfree)) or sqlerr(__FILE____LINE__);
        
mysql_query("ALTER TABLE `torrents` CHANGE `free` `free` ENUM( 'yes', 'no' ) NULL DEFAULT ".sqlesc($setfree)) or sqlerr(__FILE____LINE__);

        
header("Location: browse.php?");
        die;
}
stdhead("Set Free Leech");
?>
<h1>Set Free Leech</h1>
<form method=post action=setfreeleech.php>
<table border=1 cellspacing=0 cellpadding=5>
<tr><td class=rowhead>Free?</td><td><select name=isfree><option value="0">---- Please Choose ----</option><option value="no">No</option><option value="yes">Yes</option>
</select></td></tr>
<tr><td colspan=2 align=center><input type=submit value="Okay" class=btn></td></tr>
</table>
</form>
<?
stdfoot
();
?>
Reply With Quote