Hi,
I have been unsuccessful with getting a static .php page to run on my local wamp server.
Here are my steps according to code igniter:
1. Unzip the package.
2. Copy the CodeIgniter folders and files to my local server directory
3. Go into the application folder of code igniter ( application/config/config.php)and set my base url to http://cns_projects.com using notepad++
4. I create a file named pages.php at application/controllers/pages.php in the code igniter folder with the following code
<?php
class Pages extends CI_Controller {
public function view($page = 'home')
{
if (!file_exists('application/views/pages/'.$page.'.php'))
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);
}
5. I create a header.php file in the code igniter folder at application/views/templates/header.php with following code:
<html>
<head>
<title><?php echo $title ?> - CodeIgniter 2 Tutorial</title>
</head>
<body>
<h1>CodeIgniter 2 Tutorial</h1>
6. Create the footer in the same template folder located in the code igniter folder at application/views/templates/footer.php
© 2011
</body>
</html>
7. I entered in my web address: http://cns_projects.com/index.php/pages/view/ to see a page I created called home.php.
I got a message which says access is forbidden. Error 403.
What is I have done wrong in setting up Code Igniter so that when I create my .php file in the view I'm able to enter the url to access it.
Any help would be much appreciated. Thanks much.
Wayten