Wednesday, June 20, 2012

Assignment 2 is Finished

I just finished assignment 2. Not sure how long it took in total but today I spent around 6 hours working on it (and had worked on it previously). A large portion of this assignment was trying to understand table-free html used in the page coding. I think I made headway in this regard so that I have some ability to read and understand this sort of code but I would probably have a more difficult task actually trying to use it to write a page from scratch.

After I had the page divided into include files it still did not display correctly coming from the server. It took me awhile to realize that with my file structure and the multi-layered way I was creating the page, the browser was probably expecting the css file and image files to be within public html, even though they were within a subfolder. I fixed this by placing all the page documents within the same subfolder, so that now the relative path used for the css/images would reference the correct files. But that created another problem--it seemed a browser could not access files except those in the public_html file. I was stumped for a while until I thought of changing the permissions for the directory and file.

I noticed that main index.php file in the subfolder had read permission but not execute. I believe I needed to add execute to the permissions since a .php file  an executable file. After I changed the permissions to allow execution I was able to access the page using a browser and things looked okay. I am glad I paid some attention to Bill's lecture on file permissions.

Lastly, the structure of the page did not seem friendly to having an index page with all other files consigned to an 'include' folder. The reason for this is because the index page had its own reference to the css and image files, and I didn't think of an elegant way to reference them from both inside and outside the include file. This is an issue to be improved on later, I suppose.

PS--While this is only assignment 2, I think I already did the two assignments AFTER it, so should be on assignment 5 now, not assignment 3.

No comments:

Post a Comment