iPad connect to localhost?
Windows Vista
Windows Vista
apple4ever wrote:
iPad has no Java, maybe thats the problem…
Firewall on pc serving the web page needs to be configured to enable the web server (HTTP). this is done in windows-controlpanel-firewall-advanced options tab-select local area connection and hit the configuration button. You will see a list of available services. Check web server (http) service.
You can access the localhost on an iPad or iTouch by appending your local ip link to the beginning of any of your file paths. This link can be discovered by enabling web sharing.
If you use PHP, you can do it like this:
<?php
$localhost = 'http://your_localhost_ip_goes_here/~your_home_folder_goes_here';
?>
You can then append the path to each file using <?php echo $localhost;?>, like so:
<a href='<?php echo $localhost; ?>/~your_home_folder_goes_here/~the_relative_path_to_your_file>Link</a>
If you use HTML only, you can do it like this:
<a href='http://your_local_ip_goes_here/~your_home_folder_goes_here/the_relative_path_to_your_file>Li nk</a>
In both cases, you would do this for any external file (images, js, css, html, php, etc). What's nice is, if you have a Sites folder, you can do this and it will still work on your computer with the same url from your Sites folder. When you're ready to launch it live, simply return the file paths to how they were before. This can be simplified by doing a replace all.
The main cause of our problems with this is that we are using the Sites folder. Unfortunately I can't find an easier way to fix it than this.
Hope this helps.
Sorry everyone, the second code sample was wrong, it should look like this:
<a href='<?php echo $localhost; ?>/~the_relative_path_to_your_file'>Link</a>
Sorry again, the second one had a typo as well. It needs to be without the tilde. This is the right one, I promise.
<a href='<?php echo $localhost; ?>/the_relative_path_to_your_file'>Link</a>
I sure wish we had a little more time on here to edit our posts! 🙂 Note that this will only work in PHP files. For HTML files and for external JS and CSS files, you will need to do the HTML version that I showed above.
iPad connect to localhost?