Ciao,
Avevo postato qui la funzione per rilevare se un utente stava usando Tor o meno, con la quale viene visualizzata una immagine .png che informa di ciò, ora dato il seguente codice
dove se la funzione "IsTorExitPoint" restituisce il valore boolean "true" allora viene mostrata l'immagine "torsi.png", ora come faccio a fare in modo che invece di un'immagine faccia un redirect alla pagina "torsi.htm) mentre se è false a "torno.htm"?Codice PHP:*/
header("Content-type: image/png");
//header("Content-type: text/html");
if (IsTorExitPoint()) {
$im = imagecreatefrompng("torsi.png");
}else{
$im = imagecreatefrompng("torno.png");
}
imageAlphaBlending($im, true);
imageSaveAlpha($im, true);
imagepng($im);
imagedestroy($im);
function IsTorExitPoint(){
if (gethostbyname(ReverseIPOctets($_SERVER['REMOTE_ADDR']).".".$_SERVER['SERVER_PORT'].".".ReverseIPOctets($_SERVER['SERVER_ADDR']).".ip-port.exitlist.torproject.org")=="127.0.0.2") {
return true;
} else {
return false;
}
}
function ReverseIPOctets($inputip){
$ipoc = explode(".",$inputip);
return $ipoc[3].".".$ipoc[2].".".$ipoc[1].".".$ipoc[0];
}
grz a chi risponderà

LinkBack URL
About LinkBacks
