Jump to content

What are they mening?


Go to solution Solved by kicken,

Recommended Posts

I am reading a book about PHP and came into a problem. I can translate it well from English to Norwegian, it's not that. It's because of a lack of information and things the writer has not said/ given enough information about, or I can have overseen it. Anyway, I can't find the answer anywhere in the book. So, please help me out here. In the English text below, do they mean a level up outside the www directory when they say up a level? Do they mean I have to create i new directory/folder outside the www directory/folder named "project, or is the project directory/folder?

This is in connection with security and should ensure that visitors to a website do not get direct access via the web browser to the file "count.html.php .Can anyone tell me what is meant here?

Β "This is the text: Go ahead and move count .html.php up a level into the project directory and amend count.html.php to reference the new location".Β 

Thankful for a explanation πŸ˜ŠπŸ‘

Link to comment
https://forums.phpfreaks.com/topic/315992-what-are-they-mening/
Share on other sites

  • Solution

The document root of your project should be a sub-directory within your project, rather than the project folder itself.Β 

project
└── www
    β”œβ”€β”€ count.html.php
    └── index.php

They are saying to move that file out of the document root sub-directory and put it into the project folder itself.

project
β”œβ”€β”€ count.html.php
└── www
    └── index.php

Since the document root of the web server would point to the www sub directory, the count.html.php file is now inaccessible by any url.

  • Great Answer 1
28 minutes ago, maxxd said:

If the book is recommending using `.html.php` as a file extension,

Given the recommendation to move it out of the document root, I'm assuming they are using that extension for a template file where PHP itself is the template language.Β  Symfony uses the same extension if you opt to use raw PHP templates instead of twig ones.

If that's not the case though, then yea that extension seems silly.

5 hours ago, maxxd said:

If the book is recommending using `.html.php` as a file extension, I'd question the quality of the book to be honest. I haven't seen a reference recommend that in... well, years I think.

It's not a recommendation. Who told you that? This is taken from one of the first chapters describing/teaching about how it's possible to do an html or php site/file unreadable for visitors of the site by direct access through the browser. This chapter also describes he use of templates and the In later chapters, they are changing this to the "normal way". It's just to do It more readable and understandable for the reader. So, since I am reading and learning from the book (and the other freaks in here) I feel I am more appropriate to rate this book than one who has not. But, out on your experience and knowledge, I understand your reaction. It's easy to be the first in line to throw the first word about something or somebody. The book Is good. And I learn a lot from it. Some chapters I have to use more time on, but that is my own fault, not the book. Maxxd, I wish you a beautiful Saturday morning, day, and evening. Greetings from Thailand🌞

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.