上网 is accessing Internet, which means someone else
hosted for you somewhere. If you are trying to accessing localhost, you are assuming you have a local server running on your PC. To make that work, you will need to install and start some sort of webserver on your local machine first.
The easiest way is to install PWS (Personal Web Server) from Microsoft, and it's free. Or you can install IIS as well. In early days, PWS only supports ASP. But I think it supports PHP now as well. Please refer to PWS or IIS installation documents.
As for port number, usually it's defaulted to port 80. So you should be fine with localhost, once it's installed and configured properly and started up.
Good luck!