Welcome Guest, Not a member yet? Register   Sign In
include problem
#1

[eluser]Mitja B.[/eluser]
Code:
<?php
include_once(base_url().'sl.php');

/*
* QUICK FIX za gremonaparty.com vs gremonakoncert.com vs aranzmaji
*/
$sub = explode(".", $_SERVER['HTTP_HOST']);
$sub = $sub[0];

if ($sub == "koncerti") $URIsSections["arrangements"][1] = "gremonakoncert.com";
if ($sub != "party" && $sub !="koncerti") $URIsSections["arrangements"][1] = "ARANŽMAJI";

class MainController extends Model
{
    function MainController()
    {
        parent::Model();
    }
    
    public $IsUserURL;
    public $UserURL;
    public $IsIndex;
    
    public $URIsSections;
    public $SubController;
    public $Module;
    public $URIArray;
    public $URIAsIs;
    public $BaseURL;
    public $Subdomain;
    
    public $QueryStringArray;
    public $SEOID;
    
    public $MainViewFromURI;
    
    public function __construct()
    {
        global $URIsToMainViewsArray;
        $this->URIsSections= $URIsToMainViewsArray;
        $this->BrakeURI();
        $this->SetSubController();
        $this->SetQueryStringArray();
        $this->SetSEOID();
        $this->SetBaseURL();
        $this->SetSubdomain();
    }
    
    
    // razbij URI, da lahko podatke uporabiš dalje
    private function BrakeURI()
    {
        ....

i want to inlclude some php file include_once(base_url().'sl.php'); when i am using model, but i get error of

Quote:Severity: Warning

Message: include_once() [function.include-once]: URL file-access is disabled in the server configuration

Filename: models/MainController.php

How can i fix this in codeignitier way.
regards
#2

[eluser]Grahack[/eluser]
Your php install doesn't allow distant inclusion. if you want to 'include' your file, try a relative or absolute path, not an url.
Anyway, you shouldn't do the include work by yourself, try to make your sl.php a CI lib and load it as any other lib.
#3

[eluser]Randy Casburn[/eluser]
Put sl.php in /application/libraries then do this in your controller constructor...

var sl;
...
$this->sl = $this->load->library('sl');

Now your sl class has been instantiated for you by CI! If sl.php is not a class it looks like you've got the guns to get it there.

CI is so Cool huh!
#4

[eluser]Grahack[/eluser]
To me there shoulnd't be the .php extension.
#5

[eluser]Randy Casburn[/eluser]
yes...of course...i've fixed. Thanks Grahack!




Theme © iAndrew 2016 - Forum software by © MyBB