mirror of
https://github.com/psenough/pouet.net.git
synced 2025-01-16 20:58:27 +01:00
get rid of getenv-calls
There's no point in explicitly loading these, when they can be looked up in $_SERVER instead.
This commit is contained in:
parent
b6bbd54dfb
commit
c2e0b40695
@ -6,8 +6,8 @@ $query.="WHERE id=".$which;
|
||||
$result = mysql_query($query);
|
||||
$prod = mysql_fetch_array($result);
|
||||
|
||||
$currentip=getenv("REMOTE_ADDR");
|
||||
$referer=getenv("HTTP_REFERER");
|
||||
$currentip = $_SERVER['REMOTE_ADDR'];
|
||||
$referer = $_SERVER['HTTP_REFERER'];
|
||||
if(basename($referer)=="prod.php?which=".$which && $prod["downloads_ip"]!=$currentip)
|
||||
{
|
||||
mysql_query("UPDATE prods SET downloads=downloads+1,downloads_ip='".$currentip."' WHERE id=".$prod["id"]);
|
||||
|
2
prod.php
2
prod.php
@ -135,7 +135,7 @@ function CheckReferrer($ref) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$currentip=getenv("REMOTE_ADDR");
|
||||
$currentip=$_SERVER['REMOTE_ADDR'];
|
||||
if($prod["latestip"]!=$currentip && CheckReferrer($HTTP_REFERER) ) {
|
||||
//print("im about to add another view because my ref is ".$HTTP_REFERER." have a nice day!!");
|
||||
mysql_query("UPDATE prods SET views=views+1,latestip='".$currentip."' WHERE id=".$prod["id"]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user