I can not give you help on PHP.
But I have some questions.
What have you got, so far, that works good?
Why do you need to have an include?
From My own past experience as a commercial programmer, I only use includes when I am very confident that my code is working well, I use the includes to make my work load easier on a very a large project. Otherwise, I do not use includes on anything that I have trouble with.
When I try to learn a new coding tool, I break everything down into the smallest possible objects and still have the thing work. Also, when working with server side tools, I tried to do it on a local server in the same room with me until I am sure the code is good. Bur is this what you are doing?
I avoid doing anything from scratch until I am confident that I know all the basics and have a measure of success understanding how others do coding teaks. The only time I do any PHP code is when I need to modify somebody 's code because it has a feature That I need to change.
I understand you desire to do it from scratch. Yes, is a noble ambition. The best I can recommend is break you code down into small bits that can be tested one step at a time.
Another thing. I see you have an index.html that has php code. Thar is not allowed, I think, on my server. If I have an index.html, it must be only html. To get the thing going in PHP I had to rename the index.htnml file and let the browser load the index.php file. My server is running Apache on Linux and that is just the way it works.
Hope this is of some help.