Location: PHPKode > projects > H-tracker > takerequest.php
<?
//
//  H-Tracker v0.2
//    http://h-tracker.org
//    Based on TorrentTrader (http://www.torrenttrader.org)
//
//

require "backend/functions.php";

dbconn(true);

$userid = $_POST["userid"];
$requestartist = $_POST["requestartist"];
$requesttitle = $_POST["requesttitle"];
$request = $requestartist . "" . $requesttitle;
$descr = $_POST["descr"];
$cats = $_POST["category"];

$userid = sqlesc($userid);
$request = sqlesc($request);
$descr = sqlesc($descr);
$cat = sqlesc($cats);
if ($cats < "1")
show_error_msg("Error!","Category cannot be empty!",1);


 mysql_query("INSERT INTO requests (hits,userid, cat, request, descr, added) VALUES(1,$CURUSER[id], $cat, $request, $descr, '" . get_date_time() . "')") or die(mysql_error());


$id = mysql_insert_id();

@mysql_query("INSERT INTO addedrequests (requestid,userid) VALUES($id, $CURUSER[id])") or die(mysql_error());

//if ($SHOUTBOX){
mysql_query("INSERT INTO shoutbox (user,message,date,userid) VALUES('System', '$CURUSER[username] has made a request for [url=".$site_config[SITEURL]."/reqdetails.php?id=".$id."]".$requesttitle."[/url]', now(), '0')") or die(mysql_error());
//}


// start irc announce hack v1.0 by FLASH
if ($IRCANNOUNCE)
{
$rs = mysql_query(" SELECT name,parent_cat FROM categories WHERE id=$cat LIMIT 1") or die(mysql_error());
$ccat = mysql_fetch_array($rs);
$pcat = "".$ccat['parent_cat'].": ".$ccat['name']."";
$msg_bt = chr(3)."2 New Request: (".chr(3)."10 $request".chr(3)."2 ) Requested by: (".chr(3)."10 ".$CURUSER[username].chr(3)."2 ) Category: (".chr(3)."10 ". $pcat.chr(3)."2 )  Link: (".chr(3)."10 http://infamoustracker.org/reqdetails.php?id=$id".chr(3)."2 )\r\n";
$fs = fsockopen($ANNOUNCEIP, $ANNOUNCEPORT, $errno, $errstr);
if($fs) {
       sleep(2);
       fwrite($fs, $msg_bt);     
       fclose($fs);
        }
}
write_log("$request was added to the Request section");


header("Refresh: 0; url=viewrequests.php");
//echo "PCAT=$cat";;

?>
Return current item: H-tracker