when to use index.php instead of index.html

后端 未结 11 2393
星月不相逢
星月不相逢 2020-12-01 02:58

I am relatively new to php. There is a very basic thing that has been troubling me. I understand that php is used to make web sites dynamic. I also understand that php is on

11条回答
  •  半阙折子戏
    2020-12-01 03:44

    For example, in my index.php or another main page I mainly use php because I use variables w/ them in the rest of my site:

    
    

    Because I every time I link an image in my website so it doesn't break or something. Since I'm reusing the name all the time, I use .php to be able to have that service, because if I use the name, I can change it globally.

    I think that simple pages like 404.html, aboutus.html, or ViewOneBlogPost.html could be an HTML page, you might not need any functionality/variables for that.

提交回复
热议问题