controller function dont load |
[eluser]mehdy[/eluser]
my controller fuction is now working . but my index load perfectly. config.php $config['base_url'] = "http://localhost/codeigniter/"; $config['index_page'] = ""; route.php $route['default_controller'] = "test"; my controller text.php <?php class Test extends Controller { function Test() { parent::controller(); } function index () { echo $this->load->view('test'); } function check (){ echo "ee"; } } my view file text.php <html> <head> <title></title> <meta http-equiv = "Content-Type" content = "text/html ; charset =UTF-8" > </head> <body> <div id ="container" > <?php echo "gggg"; echo anchor('test/check' ,'new'); ?> </div> </body> </html> when i click link , it shows The requested URL /codeigniter/test/check was not found on this server. please help me .
[eluser]JHackamack[/eluser]
Unless you used mod rewrite to hide the index.php $config[‘index_page’] = “”; should be $config[‘index_page’] = “index.php”; and you should call: /codeigniter/index.php/test/check
[eluser]mehdy[/eluser]
thank you . but still no change . my previous configuration config.php $config['base_url'] = "http://localhost/codeigniter/"; $config['index_page'] = ""; routes.php $route['default_controller'] = "test"; autoload.php $autoload['libraries'] = array('database','session','email','validation'); $autoload['helper'] = array('url','form','text','date','security'); htaccess.txt RewriteEngine on RewriteCond $1 !^(index\.php|images|captcha|css|js|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] /codeigniter/system/application/controllers/ i have connect with db , do i need to change any configuration ?
[eluser]JHackamack[/eluser]
I see in your initial post you named your file "Text.php" "my controller text.php " but called the controller Test Make sure both are the same file names
[eluser]Rick Jolly[/eluser]
You are using a subdirectory. Add RewriteBase to your htaccess file. Also, try dropping the slash before "index.php/$1": Code: RewriteEngine on
[eluser]mehdy[/eluser]
thank you , yes i have chaged my htaccess file as u told , and my controller name is Test and file name is test , still no change , same error
[eluser]JHackamack[/eluser]
Does it come back with: http://localhost/codeigniter/test/check was not found? is it the browser 404 error message or a code igniter styled error message?
[eluser]mehdy[/eluser]
The requested URL /codeigniter/test/check was not found on this server. |
Welcome Guest, Not a member yet? Register Sign In |