I have read somewhere here that says that any files in the includes folder will produce a 403 error, is that correct? What can we have in a includes folder? However, because of this error, I have moved some files outside the folder but now I am getting an sql statement error but I think I have set up my dbh.php line correctly. I have included a hostname, username and password, any suggestion?
I am just wondering what is the difference between doing this: include_once ‘/dbh.php’; and include_once ‘dbh.php’;? I can get it to work with the later but not with the former…I also remember that in the actual cpanel, I needed to do this format: include_once DIR.‘/header2.php’; must I do this here?
Also, is the htdocs folder the same as public_html? Also, what can we have in the includes folder? From my understanding, any php files should not be included there or it will generate a 403 error, can we have pictures or videos?
DIR was a variable defined on normal cPanel, but not in this one. You need to include your files by using include_once 'nameofthescript.php', overwriting nameofthescript.php with the script you’re trying to load.
The htdocs folder is the same of a public_html one; the name htdocs is even used while you install XAMPP. But here “includes”, “modules” or any name that includes “chat” may bring you to a 403 Forbidden page, and the same goes for videos contained inside one of those folders or a video that contains “chat” on the name.
So what kind of files are we allowed in the includes folder? I have a file called signup2.php and that was included in the includes folder but got an error. The error message was gone when I moved it outside that folder…
In the includes folder, you could have any PHP files which are included or required into other PHP scripts, and should not be accessed through the browser directly. This could be shared components (like headers and footers), configuration files or database connection helpers.
Terrific and thanks for the excellent support here! I am still a bit confused as to what can be inside the includes folder, basically any php files should not be included in this folder? Can I have images in the includes folder ?
That depends on how these pictures and videos are going to be accessed. If you are going to use some PHP script to serve this content, then it’s no problem. But note that any file in the includes folder will be inaccessible to web browsers. This is both if you navigate to the URL directly, or when these files are linked to from within another page.