Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
It's because PHP is launched from the web server to replace the code by html.
To do that, you need to open the file through the web server.
You have 4 way of doing this.
2 are restricted to the same computer your files are on, and the others allows you to access this server from another computer (like a web site)
1) Local loop by ip address:
http://127.0.0.1/mypage.php
2) Local loop by hostname:
http://localhost/mypage.php
Both 127.0.0.1 and localhost are hardcoded constant in every systems that access TCP/IP networks.
It always point to itself.
3) remote connection by ip address:
http://192.168.0.1/mypage
Here, 192.168.0.1 could be the TCP/IP address that a wireless router gave you when you connected.
This is not a local address, and can be acessed by other computer on the same physical network than you (IE: connected to the same router, switch, hub or access point)
4) A public host name with a dynamic IP address like http://dyndns.org provides:
http://myChoosenName.dyndns.org
This means that your computer stays on, and have a little program that updates the dyndns server telling them "hey, my address on internet is now 197.85.47.13" (for the example) at each IP changes.
Dyndns.org will record this, and every person trying to reach http://myChoosenName.dyndns.org will be redirected to this adresse, thus your computer.
You could use the ip address directly too, but your ISP might change it every few hours, and in this case, you will not be able to access your server anymore.
__________________
Only a biker knows why a dog sticks his head out the window.
Last edited by tripy; 02-20-2009 at 03:08 PM..
|