Redirection problem |
[eluser]Unknown[/eluser]
First, I'm using the latest CI and Bootstrap/Boilerplate from Arnodo. I'm trying to get a login page up and running and not sure if I missed something or what. Whenever I try to go to /login if gives me a page not found. I do have login.php created in the view though. Maybe someone could be so kind to look over my code and maybe tell me something I may have missed. controller/users.php Code: <?php model/user.php Code: <?php views/pages/login.php Code: <h1>Login</h1> I'm going off the Tuts+ CodeIgniter essentials. Thanks in advance.
[eluser]PhilTem[/eluser]
1) Your URI must be users/login i.e. www.example.com/users/login 2) It must be Code: if ( $_POST ) // see the underscore? Code: if ( $POST ) 3) Use base_url with the URI as an argument, i.e. Code: base_url('home'); // creates www.example.com/home 4) Maybe you want to consider using site_url() instead of base_url() since it will always work. If you don't want to have index.php in your URI, then read into the user's guide on how to remove it. 5) You would want to check for at least one row of your query before returning $query->first_row('array'); otherwise you will get errors once there is no record matching row Just my 5ct. to helping you |
Welcome Guest, Not a member yet? Register Sign In |