How to share your localhost pages with in the internet
Know your home ip address from anywhere. Access your HomeServer localhost
How to get your home server IP address?
1. In your server, set a cron to periodically run local "set-my-ip.php" script
This will send your actual IP address to a server that is allays ON (ex:dev.joaosantacruz.com).
2. Point your OnlineServer (ex:dev.joaosantacruz.com) to "get-my-ip.php" script
This will redirect you to the actual local IP address and show your localhost content.
NOTE: Don't forget to make the appropriate changes if you're behind a router. Some tricks like port-forwarding may be considered.
set-my-ip.php
<?
file_get_contents('http://dev.
?>
get-my-ip.php
<?php
// = = = = = = = = = = = = = = = = = = = = = = = = = = = =
// IP ADDRESS UPDATE/REDIRECT [ ONLINE SERVER ]
// = = = = = = = = = = = = = = = = = = = = = = = = = = = =
//CHECK KEY AND UPDATE IP ADDRESS
if(base64_decode($_GET["key"])
file_put_contents("remote.
file_put_contents("local.
}else{ //REDIRECT TO THE STORED IP ADDRESS (CHECK IF IS LOCAL REQUEST)
$server = file_get_contents("remote.
$local = file_get_contents("local.
if($_SERVER[REMOTE_ADDR]==$
header("location: http://$local/");
elseif(!$server)
die("<center>No ip address defined!!</center>");
else
header("location: http://$server/");
}
?>