Jump to content
Vizitator

Cum aflu ip pe Yahoo messenger

Recommended Posts

Posted (edited)

Poti folosi codul asta pus pe un webhost:

<?php
// Definitions
define("SHOW_IMAGE", 0);
define("SHOW_LAST_IP", 1);
define("LOG_FILE", "log.txt");

// Variables
$cmd=SHOW_IMAGE;
$img=realpath("./something-went-wrong-graphic.jpg");

// Check if we are suposed to display IP or
if(isset($_GET["cmd"]) && $_GET["cmd"] == SHOW_LAST_IP) {
$cmd = SHOW_LAST_IP;
}
if(isset($_GET["id"])) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, base64_decode($_GET["id"]));
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
$imgblob = curl_exec($ch);
curl_close($ch);
}

if($cmd == SHOW_LAST_IP) {
$fp = @fopen(LOG_FILE, 'rb');
if(!$fp) {
echo "Failed to open file";
exit;
}
while (!feof($fp)) {
$contents .= fread($fp, 8192);
}
echo $contents;
fclose($fp);
} else {
if(isset($imgblob)) {
$image = new Imagick();
$image->readimageblob($imgblob);
header("Content-type: " . $image->getFormat());
echo $image->getimageblob();
} else {
$image = new Imagick($img);
echo $image;
}

$line = "" . date("r") . " ==> " . $_SERVER['REMOTE_ADDR'] . " [" . (isset($_SERVER['REMOTE_HOST'])? $_SERVER['REMOTE_HOST'] : "Reverse DNS lookup not enabled") . "]" . PHP_EOL;

$fp = @fopen(LOG_FILE, 'a');
if($fp) {
fwrite($fp, $line);
fclose($fp);
}
}

Trebuie editate unele variabile/definitii, dar nu e mult de lucru.

Edited by u0m3

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...