Welcome Guest, Not a member yet? Register   Sign In
having trouble with controllers
#11

[eluser]bradyrose[/eluser]
i have checked config.php and found the settings to match as you have stated,

I have put .htaccess files in both the application directory and the home directory, because I am unsure where it should be placed. Should it be the code you provided alone?

I have posted simply the information you have supplied within the .htaccess file and have attempted urls such as www.cashforbtc.com/pages/home, which yields "not found" pages.

however, www.cashforbtc.com/index.php/home , and other corresponding pages still work.

pages.php controller:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');


class Pages extends CI_Controller {

public function index()
{
  $this->load->view('index');
}



public function view($page = 'home')
    {

// show an error ir the page doesnt exist for some reason  
if ( ! file_exists('application/views/pages/'.$page.'.php'))
  {
  // Whoops, we don't have a page for that!
  show_404();
  }
  
//Capitalize the first letter of the title
$data['title'] = ucfirst($page);

// load all the helpers and libraries to be used  

$this->load->library('session');
$this->load->database();
$this->load->library('table');
$this->load->library('pagination');
$config['base_url'] = 'http://www.cashforbtc.com/index.php/feedback';
$config['total_rows'] = 300;
$config['per_page'] = 3;
$this->pagination->initialize($config);
$this->load->helper('url');
$this->load->helper('form');
$this->load->helper('captcha');

// load all the sections of the page

$this->load->view('templates/header', $data);
$this->load->view('templates/navbar', $data);
$this->load->view('pages/'.$page, $data);
$this->load->view('templates/footer', $data);

}

}

#12

[eluser]bradyrose[/eluser]
here are my current routes, or attempt to try what has been suggested, thus far the only
way im navigating to pages such as www.cashforbtc.com/index.php/home , pages/home does not work with combinations that have been suggested, or as i have miss?understood them.

Code:
//$route['pages/pmsystem/(:any)'] = 'pages/pm/$1';
// i disabled the above just to see if it was affecting below
$route['pages/pmsystem'] = '/pages/pmsystem.php';
// pages/pmsystem yeilds not found
$route['(:any)'] = 'pages/view/$1';
// when i use the route below, rather than the route above,
// index.php/login loads blank pages, and pages/login loads
// not found
//$route['page/:any'] = 'pages/view/$1
$route['default_controller'] = 'pages/view';
/* End of file routes.php */
/* Location: ./application/config/routes.php */
#13

[eluser]bradyrose[/eluser]
here is also a pastebin to my config.php file http://pastebin.com/EuHevUKQ




Theme © iAndrew 2016 - Forum software by © MyBB