simple link question |
[eluser]TomRac[/eluser]
Hi, I am new to CI but not to programming, and I am stumped by a simple link question! I have created a link like this: Code: <a href="<?php echo ROOT;?>/search/register">New Registration</a> Here is my controller page, located at: \application\controllers\search.php Code: <?php When I click on the link, the browser returns: Object not found!, and the URL points to: http://localhost/members/search/register And in config/routes.php, I put this: Code: $route['default_controller'] = "search"; Am I forgetting to do something?
[eluser]ludo31[/eluser]
First of all , you write your name class in uppercase like Code: class Search extends CI_Controller { if you would catch the function register via anchor Code: echo anchor('search/register', 'Click here');
[eluser]Rolly1971[/eluser]
you can also do this: Code: <a href="<?php echo site_url('search/register'); ?>">New Registration</a>
[eluser]TomRac[/eluser]
ok, it must be a configuration issue, because the browser is returning a 404 Page Not Found message is there a config file which I might need to edit?? :question:
[eluser]ludo31[/eluser]
have you make the configuration ??? sometimes we open : autoload , routes , database and etc to configure !! may be you must read the doc !! and I recommend you to see that : http://net.tutsplus.com/articles/news/co...tch-day-1/ |
Welcome Guest, Not a member yet? Register Sign In |