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

Yes. I tried all possible ways.

$config['base_url'] = "http://localhost/ci/";

$config['base_url'] = "http://localhost/";

$config['base_url'] = "";

$config['base_url'] = "";

Rabbi the path should have all forward slashed, this means the str_replace function isn't doing it's work. The problem is the framework relies ot the unix style separators to prevent the use of the DIRECTORY_SEPARATOR constant otherwise if you want to call a view in a subdirectory for instance you would have to do
instead of the str_replace function you could try the preg_replace_all function but that is slower.

At last, i solved it. :-)

Everything is OK in CodeIgniter.
But some tutorials or user_guide isn't showing everything correct for Windows user. This is not fair!

The following thread help me 50%.

The correct link is: (for those who are using php on Windows)

Generic format for the windows user is:

where, ci="CodeIgniter"....folder's name.

Controller's Code:
class Hello extends Controller{
    function Hello(){
    function index($name) {  
        $data['name'] = $name;  

View's Code:
        Hello, <?=$name?>!

I run Windows and I use http://localhost/ci/index.php/controller...m1/param2/

Usually IIS has issues with that, but.. well... IIS sucks

Theme © iAndrew 2016 - Forum software by © MyBB