[eluser]DavidHopkins[/eluser]
Hello all, I am trying to make a simple log in feature that works fine when i dont make use of a htaccess file in order to remove the index.php part of a url, but when i go into my config and remove the index.php from the following line my form validation always returns false.
Code:
$config['index_page'] = 'index.php';
My code looks like this
Code:
public function ProcessLogin() {
$this->load->library('form_validation');
$this->load->helper('form');
$this->load->helper('url');
$this->form_validation->set_rules('cid', 'a', 'trim|required|xxs_clean');
$this->form_validation->set_rules('email', 'b', 'trim|required|valid_email|xxs_clean');
$this->form_validation->set_rules('pass', 'c', 'trim|required|xxs_clean');
extract($_POST);
if($this->form_validation->run()==False) {
echo"false";
}
else {
echo"ok";
}
}
Code:
<div id="LoginContainer">
<?=form_open('login/ProcessLogin');?>
<h1>Login</h1>
<div id="LoginContainerRow">
<div id="LoginContainerLabel">Account No:</div>
<div id="LoginContainerInput"><input type="text" name="cid" /></div>
</div>
<div id="LoginContainerRow">
<div id="LoginContainerLabel">Email Address:</div>
<div id="LoginContainerInput"><input type="text" name="email" /></div>
</div>
<div id="LoginContainerRow">
<div id="LoginContainerLabel">Password:</div>
<div id="LoginContainerInput"><input type="password" name="pass" /></div>
</div>
<div id="LoginContainerButton">
<input name="" type="submit" value="Log In"/>
</div>
</form>
</div>
this is my htaccess file
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocum
Im not sure why it dosent work when trying to remove the index.php
any help would be great !
Dave