Noob working through tutorial |
Brand spanking new to CI and have followed the install and initial tutorial instructions step by step. Does not work according to plan on my localhost. Thought it might be something wrong with my local setup, so tried on remote web server with same issues.
After installation, the index.php page shows as expected: http://www.geopd.org/membership/index.php After following Static Pages tutorial, I get this: http://www.geopd.org/membership/index.php/pages/view/ Any helpful suggestions for where to look for solutions much appreciated!
Can you post the code for the function you are running?
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
(03-06-2016, 01:13 PM)albertleao Wrote: Can you post the code for the function you are running? application/controllers/Pages.php <? php class Pages extends CI_Controller { public function view($page = 'home') { if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) { //whoops, we don't have a page for that! show_404; } $data['title'] = ucfirst($page); //capitalize the first letter $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } }
Can you show your all view file names?
(03-06-2016, 03:34 PM)kenjis Wrote: Can you show your all view file names? views/pages/home.php Code: <p>Hello World!</p> views/pages/about.php Code: <p>Hello World!</p> views/templates/header.php Code: <html> views/templates/footer.php Code: <em>© 2016</em>
Did you add the routes to the routes file?
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(03-06-2016, 11:29 AM)muckydog Wrote: Brand spanking new to CI and have followed the install and initial tutorial instructions step by step. Does not work according to plan on my localhost. Thought it might be something wrong with my local setup, so tried on remote web server with same issues. You have a white space between <? and php, remove it and try again. (03-06-2016, 03:00 PM)muckydog Wrote: application/controllers/Pages.php Probably this has nothing to do with your problem, but `show_404` is wrong. It should be `show_404()`.
http://www.geopd.org/membership/index.php. Make sure the APPPATH is correct. Application folder & index.php is under membership folder ? You can define APPPATH in index.php file.
Keep calm.
When I enter the url http://www.geopd.org/membership/home without the index.php I see a members login page...
|
Welcome Guest, Not a member yet? Register Sign In |