Problem calling controller functions |
[eluser]Unknown[/eluser]
Hi I'm new to using CI but I'm loving it, however I have a small problem. I've developed a single page application locally using MAMP and I've just uploaded it for testing on a remote server. The remote server is using php 5.2.1 I've set the default controller in the routes config file & I've set the $config['base_url'] correctly. If I use http://my_domain.com/index.php or http://my_domain.com the page loads correctly, but if I try to call a function within the controller I am getting a 500 Internal Server Error. I've tried to create a simple controller just to test it and I'm getting the same problem. Here's what I've done to test. Changed the default controller to: testcontroller Created a controller called: testcontroller.php Code: <?php Now if I go to http://my_domain.com/index.php or http://my_domain.com I get a page that shows "Index Called". If I go to http://my_domain.com/index.php/testcontroller or http://my_domain.com/index.php/testcontr...tioncalled or http://my_domain.com/index.php/testcontr...ioncalled/ etc I'm getting the Internal Server Error. Am I overlooking something? Its been a long week Thanks Carl
[eluser]prestondocks[/eluser]
Hi Carl, I cant see anything wrong with the code you pasted here so it may be a problem with your config file. Try another default install of CI into another folder and use the welcome controller to test. Also the only thing you should need to change in config to get a very basic system working is the base_url Hope this helps
[eluser]Unknown[/eluser]
Mmm… I've installed a fresh install of CodeIgniter_1.7.2 in a directory called testinstall. Set the config to $config['base_url'] = "http://my_domain.com/testinstall/ Now I'm getting the error "Disallowed Key Characters". I've hacked an input.php function to find out what character is causing the error Code: function _clean_input_keys($str) and discovered that its a # character. Adding the # into the regex Code: [#a-z0-9:_\/-] Now if I go to http://my_domain.com/testinstall all is well. However if I try to call a function directly I get the Internal Server Error. Am I calling the function correctly? http://my_domain.com/testinstall/index.p...ome/callme Code: <?php Thanks Carl |
Welcome Guest, Not a member yet? Register Sign In |