skip to Main Content

enter image description hereThis is my first post here and i’m looking for getting some help.

I have recently taken courses in HTML/CSS/JavaScript and I feel pretty comfortable in that. Now i’m getting into PHP, and noticed that i need a localhost. I downloaded MAMP, added my website files to the htdocs but I cannot find my index.html in the localhost.

This is what I put in the browser: localhost/htdocs/web-development/Portfolio/index.html

What i’m trying to do is to preview my website and try my registration form which is done with html/css/javascript and php/phpmyadmin.

Even though I can understand and code HTML/CSS/JavaScript and still fairly new to programming so let me know if I explained it a bit messy.

I’m using Atom for coding.

Lukas

2

Answers


  1. The default configuration for MAMP uses ports 8888 and 8889, and 7888, you can see the default port in controle panel under ports

    http://localhost:{port number}/{project folder}/index.html -> ( if write php file this could be index.php)

    htdocs represents web root that you no need to use in url

    Login or Signup to reply.
  2. Based on your image, your index.html file is in your forms folder, so you have two options:

    1. Move your index.html into your portfolio file and have the server automatically serve it when the address localhost/htdocs/web-development/Portfolio is requested.

    2. Change your URL route to localhost/htdocs/web-development/iPortfolio/forms/index.html

    The first would be more in keeping with standards – the server will search for an index.html/php file in the route of a website, which is why people generally use this file for their homepage, as noted here Why do people name their files index.html?

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search