Search the Community
Showing results for tags 'include'.
In the ecommerce book, in chapter 3, you include files like so: include('./includes/header.html'); doesn't include('includes/header.html') do the same thing? Why use the ./ I don't understand. This wasn't covered in the other book I read from you php and mysql 4th edition.
In this book in chapter 2 script 2.4 index.php. It says to include the configuration file: require('./includes/config.inc.php'); How can you reference a file with ./, shouldn't it be ../ I tried it and it doesn't work. Is this a mistake in the book?
I'm back to "Book 1" ("Repetition is the mother of knowledge") - - and I have a question. When I separate recurrent parts of the web application into separate files, to be included in the index.php, is it possible to use file extensions for included files other than .html, or .inc.html, or .php? For example, what if I want to save my header and footer as header.txt and footer.txt, or even header.jpg and footer.jpg. Would the code contained in them still work if I include them with modified extensions? Is this, or something similar, ever done, for example, as a security trick?