Welcome Guest, Not a member yet? Register   Sign In
Codeigniter controller's function are not getting accessed?
#1

[eluser]Unknown[/eluser]
Hi
I am new to CI.
I have read CI documentation and viewed lot of tutorials.

I have downloaded the new 2.1.0 version.
Then, I have added a new file in the application/Controllers/ called "site.php".
Code:
<?php
class Site extends CI_Controller {

public function index()
{
  echo "Hello Buddy";
}
public function ok() {
  echo "Again Hello Buddy";
}
}
?>
In config/routes.php, i modified the following
Code:
$route['default_controller'] = "site";

ci is diretory which has all CI files.

In browser i tried to get the page with following links

**http://127.0.0.1/web/ci***
**http://127.0.0.1/web/ci/index.php***

above both links are displaying "Hello Buddy". Its works fine here !!.


But links
**http://127.0.0.1/web/ci/ok.php**
**http://127.0.0.1/web/ci/ok**

Does not show "Again Hello Buddy".
It shows as follows.
Code:
==========================================================================
Not Found
The requested URL /web/ciCont/ok.php was not found on this server.
Apache/2.2.20 (Ubuntu) Server at 127.0.0.1 Port 80
==========================================================================
What could be wrong in my code?? Please Help??
Thanks
ND




Theme © iAndrew 2016 - Forum software by © MyBB