tags:

views:

31

answers:

1

I have been learning php for sometime now. Besides reading books and doing tutorials i also like to sometimes read other programmers code. I have came across this:

<?php

    // authentication. 
    include_once($sys_root."/inc/authenticate_check.php");

I understand the use for $sys_root, but what i dont understand is, how is $sys_root bieng assigned a value.

I have checked and made sure that $sys_root is not a special var of PHP's.

+3  A: 

This file is likely included or required by another file that defines $sys_root.

Matchu
So you're saying this file itself is being include into another file that has $sys_root already defined. That would make sense.
Babiker
That's probably the case.
Matchu
or he's not showing the whole code and there's already an include before
Artefacto
@Artefacto: I made the assumption that, since he started with `<?php`, he was trying to signal that the line was at the top of the file... but maybe not!
Matchu
and if its as Matchu said, that's poor programming (global vars, ewww) .. it should be a Constant, most likely.
Erik