Welcome Guest, Not a member yet? Register   Sign In
Can't load an XML File
#1

[eluser]donkey_[/eluser]
Hi it's me again


I have this question ... currently i work on a project where i'm late well .. it's only a simple PHP site
so i used Codeigniter to build the website ... my costumer don't have any Databases ... so I must use SIMPLE XML .... i tried it ... but that doesn't Work

Code:
class Page extends Controller {

    public function view($id)
    {
        $output=array();
        if(file_exists("content.xml"))
        {
        $xmlFile=simplexml_load_file("content.xml");
        foreach($xmlFile->content as $output['content'])
            {
                echo $output['content']->id;
            }
        }else{
            echo "Can't find any file";
        }

    }
}


and so i put the file in
Code:
system/application/controller/page.php
and i put my "content.xml" also
in
Code:
system/application/controller/content.xml

but my script sayes that he can't find my file

why? I'm asking because normaly that works


Best regards - donkey_

[EDIT]
remember my script is at all not finished ... it's currently only my file problem .. the rest i will eleminate the rest of my errors :-D
[/EDIT]
#2

[eluser]narkaT[/eluser]
try an absolute path:
Code:
$file = APPPATH.'controller/content.xml';




Theme © iAndrew 2016 - Forum software by © MyBB