Safe use of require() in PHP

Viewed 48

What does the period (.) in the following php function mean:

require("./folder/file.php");

And on the security issue, is using the function in the above way safe?

1 Answers

. (dot) means a relative path, require("./folder/file.php"); means that you are working in the same folder. There no risk at all, it is just a reference to a file.

.. (two dots) is one level higher ../../ (two dots slashes) two levels higher

further info

Related