login |
[eluser]davy_yg[/eluser]
Hello, I am trying to create a login controller through CI: views/admin/login.php Code: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'> I wonder what this code means: redirect_admin(); ? routes.php Code: $route['admin/login/'] = 'admin/clogin'; controllers/admin/clogin.php Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); I wonder why I cannot see the login page just by typing: localhost/indonusaCI/admin/clogin/ ?
[eluser]Tpojka[/eluser]
Name of file must be same with name of class. Code: clogin != Login
[eluser]davy_yg[/eluser]
I change the class name to : class Clogin extends CI_Controller{ and try typing: localhost/IndonusaCI/admin/clogin and still unable to access the website login page. Object not found! Why is it?
[eluser]Tpojka[/eluser]
Code: public function index(){ You have to check and read whole code to change all affected variables/names. I've made this one for you now.
[eluser]noideawhattotypehere[/eluser]
[quote author="Tpojka" date="1382324797"] Code: public function index(){ You have to check and read whole code to change all affected variables/names. I've made this one for you now.[/quote] and why would you change views filename when its all about the controller? rofl.
[eluser]Tpojka[/eluser]
There is no admin/login file actually, but admin/clogin could redirect somewhere? Whole code is made from anothere code and variables are not changed consistently.
[eluser]davy_yg[/eluser]
I finally able to open the page by typing: http://localhost/IndonusaCI/index.php/admin/clogin Do I have to write the index.php also to view the admin page ? The url doesn't seem user friendly. Is it possible to view the admin page just by typing localhost/IndonusaCI/admin ? How is that possible ?
[eluser]35mm[/eluser]
[quote author="davy_yg" date="1382348354"]I finally able to open the page by typing: http://localhost/IndonusaCI/index.php/admin/clogin Do I have to write the index.php also to view the admin page ? The url doesn't seem user friendly. Is it possible to view the admin page just by typing localhost/IndonusaCI/admin ? How is that possible ?[/quote] Here read the manual http://ellislab.com/codeigniter/user-gui.../urls.html You can get nice, friendly URLs
[eluser]davy_yg[/eluser]
I replace my .htaccess with the following codes: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] Then, whenever I type this: localhost/indonusaCI/admin/clogin the url suddenly change to localhost/xampp , I wonder why ?
[eluser]Tpojka[/eluser]
Maybe, second line should be something like RewriteBase /indonusaCI/ |
Welcome Guest, Not a member yet? Register Sign In |