Welcome Guest, Not a member yet? Register   Sign In
Confusing simple problem
#1

[eluser]monfreex[/eluser]
Hi all,

I know you help me out with my simple problem. I don't if it's a server problem or anything but I have this page:

http://tinyurl.com/dl5h24

If you click "Create Account" button, the next page would be a 404 message. As you can see the index function works out great but the register function is not and should just ouput "hello world". Am I missing something?

The code below is my default controller:

Code:
class Start extends Controller {

    function Start()
    {
        parent::Controller();    
    }
    
    function index()
    {
        $data['title'] = "MR Barbershop and Urban Lounge | Member Directory";
        $template['content'] = $this->load->view('startpage', $data, TRUE);
        $this->load->vars($data);
        $this->load->view('template', $template);
    }
    
    function register()
    {
        echo "hello world";
    }

}
#2

[eluser]monfreex[/eluser]
Please don't mind this post. I wish I could kick myself! hahaha. Thanks for viewing anyway. I solved it already.
#3

[eluser]Mackstar[/eluser]
This is looking for a controller called register which, you need to add this to your routes file,

you can find out how to on the CI section on routes, if you enter the following I can find the register page.

http://projects.collaboria.ca/MR/MemberD...t/register

Thanks

Richard
#4

[eluser]Mackstar[/eluser]
$route['register'] = "start/register";

should do the trick!
#5

[eluser]monfreex[/eluser]
Thank you Mackstar. Your suggestion is much better than the solution I just did. I know it will work. Thank you for replying.
#6

[eluser]slowgary[/eluser]
Just to complete the post for anyone else who has this issue, the problem is that the URL is:
Code:
http://www.domain.com/index.php
which is calling the index() function of the controller just fine. But the link on the index page directs to:
Code:
http://www.domain.com/register
This omits the actual controller, which is 'Start'. The index page worked because it's the default, but the register page would need to be referenced from within the 'Start' controller, which means the URL should be:
Code:
http://www.domain.com/start/register




Theme © iAndrew 2016 - Forum software by © MyBB