in clude $_SERVER["DOCUMENT_ROOT"]; FAILING.

Xtosea

New member
Joined
Apr 21, 2022
Messages
3
Hi, I am using $_SERVER["DOCUMENT_ROOT"]; to include files but it is it failing my files in a all the page where I used it.

This is the error it's displaying
Warning: include(/home/boardgiv/domains/feedingplus.com.ng/private_html/dbase/dbaseconnection.php): failed to open stream: No such file or directory in /home/boardgiv/domains/feedingplus.com.ng/public_html/mlmpro/login.php on line 13.


This is the example of how I used it:
<?php // sanitize $_GET variables $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING); // sanitize $_POST variables $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); session_start(); include $_SERVER['DOCUMENT_ROOT'] . "/dbase/dbaseconnection.php"; include $_SERVER['DOCUMENT_ROOT'] . "/functions/mlmfunctions.php"; //include $_SERVER['DOCUMENT_ROOT'] . "/functions/functions.php"; function testinput($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; }
?>
Can someone help? Thanks.
 
Well, your error says the file dbaseconnection.php does not exist at this location:

Code:
/home/boardgiv/domains/feedingplus.com.ng/private_html/dbase/

- Is it present there? Is it readable?
- Do you use private_html as a symlink to public_html or is it a separate folder?
 
Yes is using private_html symlink to public_html. Is not a separate folder. But I have l been trying to make it public_html separately from private_html but I am not getting it. Please any idea, kindly help me thanks
 
What does

ls -al /home/boardgiv/domains/feedingplus.com.ng/private_html/dbase/dbaseconnection.php

show?
 
Back
Top