Thread: Where Function
View Single Post
  #1  
Old 19th September 2022, 10:44
hax0r hax0r is offline
Banned
 
Join Date: Sep 2022
Posts: 12
Smile Where Function
$where = where ($_SERVER["SCRIPT_FILENAME"], $row["id"], 0);
SQL_Query_exec("UPDATE users SET last_access='" . get_date_time() . "', ip=".sqlesc($ip).", page=".sqlesc($where)." WHERE id=" . $row["id"]);


function where ($scriptname = "index", $userid, $update=1){
if (!is_valid_id($userid))
die;
if (preg_match("/torrents-details/i", $scriptname))
$where = "Browsing Torrents Details (ID: $_GET[id])...";
elseif (preg_match("/torrents.php/i", $scriptname))
$where = "Browsing Torrents...";
elseif (preg_match("/account-details/i", $scriptname))
$where = "Browsing Account Details (ID: $_GET[id])...";
elseif (preg_match("/torrents-upload/i", $scriptname))
$where = "Uploading Torrent..";
elseif (preg_match("/account/i", $scriptname))
$where = "Browsing User Control Panel...";
elseif (preg_match("/torrents-search/i", $scriptname))
$where = "Searching Torrents...";
elseif (preg_match("/forums/i", $scriptname))
$where = "Browsing Forums...";
elseif (preg_match("/index/i", $scriptname))
$where = "Browsing Homepage...";
else
$where = "Unknown Location...";

if ($update) {
$query = sprintf("UPDATE users SET page=".sqlesc($where)." WHERE id ='%s'", mysqli_real_escape_string($GLOBALS["DBconnector"],$userid));
$result = SQL_Query_exec($query);
}
return $where;
}
Reply With Quote