Welcome Guest, Not a member yet? Register   Sign In
Problem with Form Validation and Htaccess file
#1

[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">
&lt;?=form_open('login/ProcessLogin');?&gt;
<h1>Login</h1>
    
    <div id="LoginContainerRow">
     <div id="LoginContainerLabel">Account No:</div>
        <div id="LoginContainerInput">&lt;input type="text" name="cid" /&gt;&lt;/div>
    </div>
    
    <div id="LoginContainerRow">
     <div id="LoginContainerLabel">Email Address:</div>
        <div id="LoginContainerInput">&lt;input type="text" name="email" /&gt;&lt;/div>
    </div>
    
    <div id="LoginContainerRow">
     <div id="LoginContainerLabel">Password:</div>
        <div id="LoginContainerInput">&lt;input type="password" name="pass"  /&gt;&lt;/div>
    </div>
    
    <div id="LoginContainerButton">
     &lt;input name="" type="submit" value="Log In"/&gt;
    </div>
&lt;/form&gt;
</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


Messages In This Thread
Problem with Form Validation and Htaccess file - by El Forum - 05-27-2012, 05:00 AM
Problem with Form Validation and Htaccess file - by El Forum - 05-27-2012, 11:00 AM
Problem with Form Validation and Htaccess file - by El Forum - 05-27-2012, 03:12 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 02:02 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 02:15 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 02:20 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 02:37 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 02:40 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:26 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:33 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:40 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:46 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:48 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:50 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:53 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:55 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:57 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:58 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 03:59 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 04:02 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 04:03 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 04:25 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 07:21 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 08:01 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-28-2012, 08:25 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-29-2012, 01:27 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-29-2012, 04:15 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-29-2012, 06:16 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-29-2012, 06:43 PM
Problem with Form Validation and Htaccess file - by El Forum - 05-30-2012, 12:52 AM
Problem with Form Validation and Htaccess file - by El Forum - 05-30-2012, 02:07 AM
Problem with Form Validation and Htaccess file - by El Forum - 05-30-2012, 08:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB