0

I've got a friend who's having trouble with his site that's using CodeIgniter. Unfortunately, I'm not familiar enough with CodeIgniter, so I thought I'd get one of you experts to quickly answer two questions:

  1. The site is mtyedjs[.]com. On the homepage, when you click "create a profile" on the right, it goes to http://mtyedjs.com/index.php/home/create_account. Instead it should be going to http://mtyedjs.com/application/views/create_account.php. Where do I go to change this?

  2. Also, when going to the appropriate create_account.php page above, there is a database connection error. All the information in config/database.php is correct. What is the issue?

2
  • What is the error you are getting at 2? Commented Oct 3, 2011 at 23:35
  • This is similar to going to the doctor and say "My arm hurts, what is your diagnosis?" Commented Oct 3, 2011 at 23:37

1 Answer 1

2

If you read CodeIgniter's manual, you'll understand that the path http://mtyedjs.com/index.php/home/create_account means that you should have a controller named 'home' and a method 'create_account' inside it. Then this path will be valid path (of course if you don't have you own routes).

http://mtyedjs.com/application/views/create_account.php - this is not right. create_account.php - this is you view file, because it in the views folder. Read about the MVC-model - it'll be clear to understand what I mean. So you should load this view in your method 'create_account'; it'll be something like this:

class Home extends CI_Controller {
    function __construct() {
        parent::__construct();
    }

    function create_account() {
        $this->load->view('create_account');
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

I'm sorry your english is hard to follow. Can you give me step my step directions including what files to make the edits in?
added some info. What is not understandable to you?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.