My plan is to use EE as an admin portal for users so they can update my CI application. The way I need it to work is, EE template Login -> give them access by using an external source API for the login Validation. Once they have access they will hit a search Template-> on typing a search query they will get results from an external database not exp_database (I'll be using a custom search module here.)
Like CodeIgniter I would like to connect my login template in EE to a custom controller in EE. Would I need to make a custom module for this functionality?
I did look up something on https://stackoverflow.com/questions/6588954/expression-engine-controllers and followed their ideas but it doesn't seem to work. I get errors like
"The following errors were encountered This form has expired. Please refresh and try again. Return to Previous Page"
Below is the index login page, I created: url is localhost/login/index.php
<title>Login Screen </title>
<link>bootstarp file</link>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-2">
<form class="form-horizontal" action='controllers/LoginController.php' method="POST">
<fieldset>
<div id="legend">
<legend class="">Login</legend>
</div>
<div class="form-group">
<!-- Username -->
<label c for="username">Username</label>
<div class="controls">
<input type="text" id="username" name="username" placeholder="" class="form-control input-xlarge ">
</div>
</div>
<div class="form-group">
<!-- Password-->
<label for="password">Password</label>
<div class="controls">
<input type="password" id="password" name="password" placeholder="" class="form-control input-xlarge">
</div>
</div>
<div class="form-group">
<!-- Button -->
<div class="controls">
<input name="submit" class="btn btn-success" type="submit" value=" Login ">
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</body>
</html>
here is the controller url (which is a template is the same login.group): login/CheckLogin -CheckLogin has Allow PHP enabled -php Parsing Stage - input and Output (tried both still gives me the same error)
<?php
class CheckLogin extends CI_Controller {
public function index() {
login_name = $_POST['username'];
login_password = $_POST['password'];
//Login Validation
}
}
?>
I have also disabled/commented out the routes in config.php as well
$route['default_controller'] = "ee/index";
$route['404_override'] = "ee/index";
It still doesn't work ... I'm hoping it will be something very very stupid (most of the time it is). Any kind of suggestion or example code structure would help.