Welcome Guest, Not a member yet? Register   Sign In
404 Page Not Found
#1

[eluser]london77[/eluser]
Hello,

I am pretty new for CI and was doing first exercise from CI book,

I have done exactly what they say in the book but keep getting the same error.

Please help in my first trouble.
this is the error.

404 Page Not Found

this is my base_url

$config['base_url'] = 'http://127.0.0.1/packt';

this is my default controller

$route['default_controller'] = "start";
$route['404_override'] = '';

this is testview file

Code:
<html>
<head>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0
Strict//EN'http:\/\/www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
&lt;html&gt;

&lt;title&gt;Web test Site&lt;/title&gt;

&lt;base href= &lt;?php echo "$base"; ?&gt; &gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo
"$base/$css";?&gt;"&gt;                      
&lt;/head&gt;

&lt;body&gt;
<h1>&lt;?php echo $mytitle; ?&gt; </h1>
<p class='test'> &lt;?php echo $mytext; ?&gt; </p>
&lt;/body&gt;
&lt;/html&gt;

and this is the start Controller


Code:
&lt;?php



class Start extends CI_Controller {
    
    var $base;
    var $css;
    
}

function __construct(){
    parent::__construct();
    $this->base=$this->config->item('base_url');
    $this->css=$this->config->item('css');
}
    
    function hello($name)
    {
        
        $data['css'] = $this->css;
        $data['base'] = $this->base;
        $data['mytitle'] = 'Welcome to this site';
        $data['mytext'] = "Hello, $name, nnow we're getting dynamic!";
        $this->load->view('textview', $data);
        
    }

?&gt;

when I type http://127.0.0.1/packt/index.php/index/start/fred
its giving 404 error, please help where am i doing wrong.

Thanks in advance





Theme © iAndrew 2016 - Forum software by © MyBB