[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'>
<html>
<title>Web test Site</title>
<base href= <?php echo "$base"; ?> >
<link rel="stylesheet" type="text/css" href="<?php echo
"$base/$css";?>">
</head>
<body>
<h1><?php echo $mytitle; ?> </h1>
<p class='test'> <?php echo $mytext; ?> </p>
</body>
</html>
and this is the start Controller
Code:
<?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);
}
?>
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