Trouble with basic navigation. |
[eluser]duartix[/eluser]
I'm new to CI and besides other affairs, I'm having a few difficulties with basic navigation... My default controller is like this: applications/controllers/home.php Code: <?php the view is the following: applications/views/login.php Code: \\<form method="post" action="home/login"> The action gets cut in this post but it's: action="home/login" My routes configuration is this: Code: $route['default_controller'] = 'home'; When I click the login button the browser navigates to http://localhost/glup2/home/login but instead of invoking the login method from the home controller it goes to a 404 error page instead. What am I missing ? Thanks in advance.
[eluser]InsiteFX[/eluser]
Place php comment tags in front of the code then it will show all of it. ( // ) Code: // <form name="input" action="home/login" method="post"> And now it doe's not work any more... Had to paste it in again for it to work.
[eluser]Otemu[/eluser]
What happens when you navigate directly using this url http://localhost/glup2/index.php/home/login if you can get to the page like this then you need to use ht.access to remove the index.php or change you form action to url above
[eluser]Unknown[/eluser]
Your form action should be "index.php/home/login". You can also use the CI built in function to open form: form_open(). You will not need to add index.php if you use form_open() method. <?php $this->load->helper('form'); //must load the form_helper before use echo form_open('welcome/login'); //will produce<form acti method="post" accept-charset="utf-8"> //to close form form_close(); //more about form helper here ?>
[eluser]duartix[/eluser]
Thank you all once again. All solutions proved useful and enlightening. |
Welcome Guest, Not a member yet? Register Sign In |