Welcome Guest, Not a member yet? Register   Sign In
problem with require_once inside a view
#4

(02-24-2016, 10:45 AM)cupboy Wrote:
(02-24-2016, 12:04 AM)skunkbad Wrote: require and require_once are generally for paths, not URLs. Your use of $baseurl would seem to indicate that you are trying to load a URL. Instead, try to use constants like FCPATH, which is the path to the "Front Controller" or index.php. Like this:

FCPATH . 'inc/functions.php'

Excellent! Never heard of FCPATH before but it works great. Thanks.

Glad to see that you've learned something new in FCPATH, but there are two more important things to note here:

- Having scripts such as your functions.inc.php in a publicly-accessible area is a bad idea in the first place.
- require_once() (and its similar counterparts) load local filepaths, not URLs.
Reply


Messages In This Thread
RE: problem with require_once inside a view - by Narf - 02-24-2016, 11:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB