I have this condition :
/public_html/folderX/test.php
has a line : require_once '../functions/sendemail.php'
/public_html/functions/sendemail.php
has a line : require_once '../config.php'
config.php
loads perfectly in this situation.
the problem occurs when I try to add that functions/sendemail.php
on file(s) which not in the folderX, for example :
when I tried to add require_once 'functions/sendemail.php'
on public_html/test.php
I got this error message :
Warning: require_once(../config-min.php) [function.require-once]: failed to open stream: No such file or directory in public_html/test.php
how to make require_once '../config.php'
inside functions/sendemail.php works 'independently' so wherever it's included on any files this 'require_once' problem won't occur anymore.
I tried to change into 'include_once' but still doesn't work.
thanks!
try something like
require_once( dirname(__FILE__).'/../config.php')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With