Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Sounds to me that your apache isn't running. You can also try simply attaching to http://127.0.0.1 in case localhost isn't redirected to loopback for whatever reason. If that still doesn't work, check your lamp console (assuming they have one), or check your services to make sure that the apache is running.
    file:// is pretty much useless. It works for .html since the browser knows how to interpret .html files. You need to go through http in order to interact at a server level.

  • #3
    New Coder
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it is running, but the browser has some settings that disallow it to access localhost
    I'm just wondering whether it is possible to log client information to the server sql database if I use "file:///"

    Quote Originally Posted by Fou-Lu View Post
    Sounds to me that your apache isn't running. You can also try simply attaching to http://127.0.0.1 in case localhost isn't redirected to loopback for whatever reason. If that still doesn't work, check your lamp console (assuming they have one), or check your services to make sure that the apache is running.
    file:// is pretty much useless. It works for .html since the browser knows how to interpret .html files. You need to go through http in order to interact at a server level.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    No, you can't execute any server commands when accessing via file. Enable your browser access to localhost if you want to use a server side language.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •