Error 404 Object not found |
Hello, I work almost one week on this problem and can´t think any furhter myself.
I´m new at codeigniter and in php programming as well. I try to explain you my problem, but if you need more information please ask. My routes: PHP Code: $route['default_controller'] = 'login'; In my controller' directory I have the file: login.php PHP Code: <?php The index function here loads the view: first_message.php Code: <html> So far, everything works fine. The URL in my browser is now: localhost/home After typing the username and the password I push the "Login"-Button. Now the browser links to this URL: http://localhost/home/page1.php to start page1.php: PHP Code: <?php Instead, I get the error: Object not found! The requested URL was not found on this server. So, I hope it became clear what my problem is and I hope you can give me hint to solve it. Thank you and best regards
Your page1 is it's own controller meaning the URL localhost/home/page1 will not work because page1 is not a method of the home controller.
Change the url to localhost/page1 or add the page1 method to your home controller.
It seems you don't understand the relation between URL and controller (file and name) in CodeIgniter.
See http://www.codeigniter.com/user_guide/general/urls.html And it would be better you read http://www.codeigniter.com/user_guide/tu...index.html
Thank you for the hints.
Now I understand the constructs of an URL: http://example.com/[controller-class]/[controller-method]/[arguments] So, I know my page1.php should be a method of the controller-class login.php. But I still don´t know how it helps me to open the view second_message.php if I click on the login-button. So when I change to a method in the controller-class, what do I write in: .....action= ''..... ![]()
If page1 is a method of your Controller Login then your URL would be
http://www.example.com/login/page1 And an action of a form points to a page... |
Welcome Guest, Not a member yet? Register Sign In |