Project

General

Profile

Feature #6374 ยป CheckIP.php

CheckIP.php - Caching Headers - NOYB NOYB, 02/02/2017 07:45 PM

 
<?php
/*
HTTP/1.1 200 OK
Content-Type: text/html
Server: DynDNS-CheckIP/1.0
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 105
Connection: close
<html><head><title>Current IP Check</title></head><body>Current IP Address: 123.456.78.90</body></html>
*/


$result = headers();
//$result = header_register_callback('headers');


print '<html><head><title>Current IP Check</title></head><body>Current IP Address: ' . $_SERVER['REMOTE_ADDR'] . '</body></html>';
print "\r\n";


function headers() {
header_remove();

# header_remove('Date');
header_remove('Expires');

header_remove('Server');
header_remove('X-Powered-By');

header('Cache-Control: no-cache');
header('Connection: close');
# header('Content-Length:');
# header('Content-Type:');
header('Pragma: no-cache');
header('Server: DynDNS-CheckIP/1.0');
}
?>
    (1-1/1)