Welcome Guest, Not a member yet? Register   Sign In
Hello World problem for beginner

After this post

I made a file named "blog.php" in application\controllers\blog.php.

Here is my code, which i have written in the file blog.php
class Blog extends Controller {

    function index()
        echo 'Hello World!';

have you got your database configured out yet ?

But why should i configure database here? I am not using database.

ow i c ^^.
Maybe you can try adding this lines in your class constructor

Hopes that works Big Grin

No you don't need to configure a database by default.

Try putting the hello world into a view instead of outputting it and call the view file. That is the way the hello world should function if you want to follow the MVC pattern.

There should be no problem with the controller as it is. I don't see how you get the error message you see on your screen. Are you including an external file somewhere or autoloading a custom library, helper, model or plugin?

A possible problems is you didn't configure the default controller a

RaiNnTeaRs I was going to agree with you... but he didn't add a constructor so that's not an issue.

The default controllers can't be the issue as he is directing to a specific controller.

What exactly is the error though?

OK thnx. Sorry for disturbing you guys.

Nothing is working. Btw, i am now debugging the main "index.php".
if (strpos($system_folder, '/') === FALSE)
    if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
        $system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
    // Swap directory separators to Unix style for consistency
    $system_folder = str_replace("\\", "/", $system_folder);
//edited my RABBI(me)
//i edited this line for seeing the $system_folder output
echo $system_folder;

It is showing this: "C:\Inetpub\wwwroot\ci/system"

Is it correct actually?

In Internet Explorer, this link:
is telling that "The page cannot be found".

You shouldn't need to touch the main index file. Did you correctly set the base_url? It should be or localhost.

Theme © iAndrew 2016 - Forum software by © MyBB