Welcome Guest, Not a member yet? Register   Sign In
Newbie and CodeIgniter Examples
#1

Good afternoon everyone.  I am in the process of building a new website for my company and I am now working with CI in order to have a solid framework that will allow me to keep my site secure.  It'll be a subscription site, but I plan to use a payment company's API to process my subscriptions as I want nothing to do with payments or the certifications it requires.

So, in reading about security I found that most recommendations was to use a framework to build your site, which most have built-in security for secure sites.  I looked at CakePHP and I couldn't get it to work nicely on my system, which then led me down the road to Zend.  While installing Zend using a tutorial for MAMP and OSX, the author recommended a more lightweight framework for newbies to the M-V-C world, which is me.  So, I decided to look at CI and I was impressed with how easy I was able to get it up and running on my system.  Minimal headaches!

I have been working my way through the tutorials and completed the tutorial on the news site and am now working my way through the General Topics and have run into a problem.  The controller example had me create a controller named blog.php.  I copied the code from the example and pasted it into my editor (TextWrangler) and then saved the file to my application/controllers folder.  For clarity my site is http://localhost:8888/codeigniter/.  I am getting a 404 page not found error when I go to http://localhost:8888/codeigniter/index.php/blog/.  The strange thing is that http://localhost:8888/codeigniter/index.php/news/ works fine.  The permissions and ownership are identical on both blog.php and news.php in the controllers folder.

Can anyone elaborate as to why I get this error with blog.php and not news.php?

The example codes is:
Code:
<?php
    class Blog extends CI_Controller {

        public function index() {
            echo 'Hello World!';
        } // Index
    } // Blog
?>

The one difference in this example that I noticed is the closing "?>" at the bottom of this controller whereas the other examples do not contain this.  I tried removing it and the results do not change. The apache log does not show any errors either.

Thank you for any help.

Tom
Reply


Messages In This Thread
Newbie and CodeIgniter Examples - by tcarroll2 - 02-04-2015, 11:57 AM
RE: Newbie and CodeIgniter Examples - by Narf - 02-04-2015, 05:54 PM
RE: Newbie and CodeIgniter Examples - by RobertSF - 02-04-2015, 05:55 PM
RE: Newbie and CodeIgniter Examples - by RobertSF - 02-05-2015, 01:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB