• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Form Validation and Htaccess file

#11
[eluser]InsiteFX[/eluser]
Ok, well that tells us that you are not getting the post data from the form.

Try giving the input submit a name.
Code:
<input name="my_submit" type="submit" value="Log In"/>

Also try replace the $_POST with this
Code:
var_dump($this->input->post(NULL, TRUE)); // returns all POST items with XSS filter
exit;

#12
[eluser]InsiteFX[/eluser]
Another thing to try
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";
   $this->load->view('your_login_form');
  }
  else {
  echo"ok";
  var_dump($this->input->post(NULL, TRUE)); // returns all POST items with XSS filter
  exit;
  }
}

#13
[eluser]DavidHopkins[/eluser]
Nope just get a

Quote:bool(false)

I was just testing some things out and created a simple html form that posted data to a php file which would echo it and that worked fine, it passed the information across ok.

As a process of elimination i think its gotta be the htaccess file doing something odd, because Post data works on my server just fine without it but as soon as its turned on, it all breaks down. Really odd... Sad

#14
[eluser]InsiteFX[/eluser]
rename it to sav.htaccess and add the index.php back in and see if it works, if its the
.htaccess file it should be an easy fix.

#15
[eluser]DavidHopkins[/eluser]
Yep works without the htaccess file and with the index.php back in, but i get the horrible
http://domain.co.uk/index.php/login/ProcessLogin

which i want to avoid

Dave

#16
[eluser]InsiteFX[/eluser]
Try removing the ?
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    #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

    ErrorDocument 404 /index.php
</IfModule>

You might try removing the RewriteBase / also

#17
[eluser]DavidHopkins[/eluser]
Big Grin thank you ever so much it works !

Three days of pulling my hair out all for a ? Tongue

Cheers man your help has been most useful !

Dave

#18
[eluser]InsiteFX[/eluser]
Your very welcome,

The ? was used for php4

Here is My .htaccess file
Code:
<IfModule !mod_rewrite.c>
# Un-Comment to Generate a server 500 error to make sure .htaccess file is working!

AddHandler application/x-httpd-php53 .php
php_value default_charset utf-8

Options FollowSymLinks
DirectoryIndex index.php

RewriteEngine On
RewriteBase /

#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 $1 !^(index\.php|assets|css|js|images|img|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>

#19
[eluser]DavidHopkins[/eluser]
Sorry to be a fool, i forgot to remove the indx.php in the config Sad

Its still not working =[

Tried removing the rewrite base aswell

Dave

#20
[eluser]InsiteFX[/eluser]
I have to eat now but will be back on a little later.

Play around with your .htaccess file and links that seems to be the problem


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.