Welcome Guest, Not a member yet? Register   Sign In
Include a File - Get variable error
#1

[eluser]Unknown[/eluser]
Hello!

I m totally new using CI and a problem are working arround me with this plataform.

I need to include a file, that contains only ONE variable into many pages, specific inside MODEL - to adjust few sql queries.

I m using the default

Code:
include ("file.php");

Inside file.php, I have:

Code:
$siteid = "01AdDsII";

I need this variable accessible inside the model folder files, using the include function.

When I try to load, I receive an error message:


A PHP Error was encountered

Severity: Notice

Message: Undefined variable: siteid

Filename: models/usuarios.php

Line Number: 265

Where I can declare / define this variable?

Any help is much appreciated !

Thanks,
Rafael
#2

[eluser]CroNiX[/eluser]
Why not use a config setting for that?




Theme © iAndrew 2016 - Forum software by © MyBB