• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function not working

I followed the video tutorial and set up a CI site. When I use the link to the next function, www.mysite.com/index.php/blog/comments/ it does not run the comments function function comments()
echo 'testing...';

It runs the default function index().

I have set up route default to the blog controller.

Any help would be appreciated.


[eluser]David Cassidy[/eluser]
It may be of some help if you include the contents of your Controller and your routes.php file. It sounds like your route may be overriding your page requests. It is hard to tell however, with so little to go on.

Here is my products controller

class Products extends Controller {

function Products()



function index()

$this->load->model('categorymodel','', TRUE);


function getCategory()
echo 'category testing...';


this is what I have set up in my routes page $route['default_controller'] = "products";

When I click on a link it puts in the url http://localhost/mysite/index.php/products/getCategory which is supposed to run the getCategory() function in the products controller and echo "category testing...", it does not.
Any idea why not?

Thanks for any help.

I found my problem. my URI PROTOCOL
$config['uri_protocol'] = "AUTO";
Was commented out. I un-commented and it works.

Sorry if any one was thinking about this much.

And thanks Dave_C for responding.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.