Avatar of Pete Winter
Pete Winter
Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

require_once()

I have the below code which basically goes to a file which connects to my mysql database.

require_once('Connections/conn_xxx.php');

How this code is within a template and I want folder destination to work regardless of the folder level of the connecting file.

So I though the below would work so starts at the root.

require_once('/Connections/conn_xxx.php');

but it failed and so did the below:

require_once('http://www.xxxx.com/Connections/conn_xxx.php');

Why is this? I would have thought an absolute path would be fine?
PHP

Avatar of undefined
Last Comment
Pete Winter

8/22/2022 - Mon