If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

access local html page through "file:///"

I installed LAMP
and I want to use ajax to write some client information into mysql server on the server side.
I want to test a anonymous browser.
however, with this browser, pages like "http://localhost/test.html" can't be accessed because the browser can't establish a connection to the server at localhost.
but it can access the page through: file:///var/www/html/test.html

however, my intention is to use ajax to write some client information into mysql server on the server side, so through file:/// can't achieve this goal,
are there any potential solutions for this?
thanks!

If you can't connect to your page by using localhost it sounds very much like your web server isn't running.
What happens when you try and (re)start Apache from the command line? Does it spit out any error messages?

> it is running, but the browser has some settings that disallow it to access localhost

Really? How does that happen? Are you using a computer that has certain settings restricted beyond your control? Every browser that I've ever used can connect to localhost / 127.0.0.1 - with the possible exceptions of Internet Explorer and Safari, but given that they don't run on Linux I haven't used them for aeons.

> I'm just wondering whether it is possible to log client information to the server sql database if I use "file:///"

It depends which languages you're using. PHP will only run via an intermediary web server. JavaScript will work.
Even if you don't need PHP and can get by just with JavaScript, I'd caution against it. Your development environment should mirror as closely as possible the environment in which you eventually deploy your work, e.g. if the server where you anticipate deploying your work is running Debian 6, then do your web development on an instance of Debian 6. (this is where virtual machines come in hand.)
Otherwise, you'll be prone to finding that certain things don't work exactly as you expected when your work is set to go live.

I just want to use youtube API to get some statistics information and log these information
but I can't use javascript to create files for logging these information on client side, so someone suggests me to set up a webserver and use ajax
however, I'm investigating Tor browser bundle and this browser can't access localhost
I don't want that the webserver locates in another machine, because I don't want the delay between the client and the server (it can be several seconds due to Tor browser routing)

Oh, I see.
In that case, the best idea I can think of would be to write a program in JavaScript that periodically appends the relevant information to your browser window, preferably in a convenient data interchange format such as JSON. Then, when you've got the information you need, you could save the data from your browser window as a text file, process it with a scripting language of your choice (virtually every language under the sun supports JSON) and then input it to your MySQL database. Well, that's probably how I'd attempt to do it. Can't really offer any more specific advice - unfortunately know nothing at all about the YouTube API.