Well, was thinking keeping track of all the ports either requires bookmarks, or on your server a page of links.
Since you are on your server already with option b, why then conform to their domain/hostnames?
The only + dyndns has is the application, but that is also a hinderance imo, I like the least amount of things installed on computers as possible.
Went with the file route, will post code.
Directory structure:
home dir
-index.php
-ip dir
--index.php
--ip.txt
record.php (the get ip and store it)
<?php
function GetVisitorRealIP()
{
$fwd_ip_string = getenv("HTTP_X_FORWARDED_FOR");
$fwd_ip = "";
if (StrLen($fwd_ip_string))
{
$fwd_ip_list = explode("," , $fwd_ip_string);
$fwd_ip = $fwd_ip_list[0];
}
return $fwd_ip;
}
if (getenv(HTTP_X_FORWARDED_FOR))
{
$ip=GetVisitorRealIP;
}
else
{
$ip=getenv(REMOTE_ADDR);
}
echo($ip);
$file = "ip.txt";
$open = fopen($file, "w");
if ($open){
fwrite($open, "$ip");
fclose ($open);
}
else {
echo('<br /><span style="color: red;">Couldn\'t open file, check that it exists and has 777.</span>');
}
?>
- <?php
- function GetVisitorRealIP()
- {
- $fwd_ip_string = getenv("HTTP_X_FORWARDED_FOR");
- $fwd_ip = "";
- if (StrLen($fwd_ip_string))
- {
- $fwd_ip_list = explode("," , $fwd_ip_string);
- $fwd_ip = $fwd_ip_list[0];
- }
- return $fwd_ip;
- }
-
- if (getenv(HTTP_X_FORWARDED_FOR))
- {
- $ip=GetVisitorRealIP;
- }
- else
- {
- $ip=getenv(REMOTE_ADDR);
- }
- echo($ip);
-
- $file = "ip.txt";
- $open = fopen($file, "w");
- if ($open){
- fwrite($open, "$ip");
- fclose ($open);
- }
- else {
- echo('<br /><span style="color: red;">Couldn\'t open file, check that it exists and has 777.</span>');
- }
- ?>
index.php (the view results page)
<?php
$file = ("ip/ip.txt");
if (file_exists($file)) {
}else{
print "file doesn't exist";
}
$fo = fopen($file, 'r');
$ip = fgets($fo);
fclose($fo);
echo('<a href="http://'.$ip.':9091"><img src="/site/images/transmission.png"></a> <a href="http://'.$ip.':8080"><img src="/site/images/router.png"></a>');
?>
- <?php
- $file = ("ip/ip.txt");
- if (file_exists($file)) {
- }else{
- print "file doesn't exist";
- }
- $fo = fopen($file, 'r');
- $ip = fgets($fo);
- fclose($fo);
- echo('<a href="http://'.$ip.':9091"><img src="/site/images/transmission.png"></a> <a href="http://'.$ip.':8080"><img src="/site/images/router.png"></a>');
- ?>