HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/xampp/htdocs/phpmailer/ipfinalX.php
<html><head><meta http-equiv="refresh" content="3600;url=ipfinalX.php"></head><body>
<?php

//code has been updated to only send email if the ip has changed.  no more full mailboxes.
//you must enable read and write permission on the ipcheck.txt file

$url = 'http://checkip.dyndns.org/';

$raw = file_get_contents($url);

$newlines = array("\t","\n","\r","\x20\x20","\0","\x0B");

$content = str_replace($newlines, "", html_entity_decode($raw));

$start = strpos($content,'^');

$end = strpos($content,'?',$start) + 8;

$ip = substr($content,$start,$end-$start);
echo "herex";
echo "{$raw}"; //this is the external ip you can pop in anywhere.
//echo "ip:".$ip;
$myFile = "ipcheck.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, 1000);
fclose($fh);
if ($raw == $theData) { die; } 
//if (1<1) { die; } 
else { $fw = fopen($myFile, "w");
fwrite ($fw, $raw);
fclose ($fw); 

				$toEmail = "[email protected]";
				$subject = "pppOE ip Address";
				$content = "{$raw}";
				$mailHeaders = "From: [email protected]\r\n";
				if(mail($toEmail, $subject, $content, $mailHeaders)) {
					$message = "You have registered and the activation mail is sent to your email. Click the activation link to activate you account.";	
				}


echo "<br><br>";
echo "Message has been sent";
}
//echo $myFile; for testing.
//echo $raw;
//echo $theData;

?>

<br>

<br>


<?php



?>
</body></html><?
?>