Welcome Guest, Not a member yet? Register   Sign In
ASO: Form validation - possible post issue
#1

[eluser]Unknown[/eluser]
Host: asmallorange.com

I've never ran into such trouble getting a simple form validation script running until I tried on asmallorange. I do not have any htaccess rewrites, but I do have xss/csrf on.

Google already helped me to find that ASO needs the following set to work (although it didn't help)

Code:
$config['uri_protocol'] = 'REQUEST_URI';

I have a form which uses the form helper to generate the form tag

Code:
<?php echo form_open('a'); ?>

Then I have the controller

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class A extends CI_Controller {
function __construct()
{
  parent::__construct();
}

public function index() {
  $this->load->helper(array('form', 'url'));

  $this->load->library('form_validation');

  // set validation rules
  $this->form_validation->set_rules('name', 'Name', 'trim|required|min_length[5]|xss_clean');
  $this->form_validation->set_rules('email_1', 'Email', 'trim|required|valid_email');
  $this->form_validation->set_rules('email_2', 'Confirm Email', 'trim|required|valid_email|matches[email_1]');

  if ($this->form_validation->run() == FALSE)
  {
   $this->load->view('signup_form');
  }
  else
  {
   $this->load->view('formsuccess');
  }  
}
}

I cannot get any validation to be performed, it always renders the form with no error output. I am using

Code:
form_error('name')
for example in the form

I believe it's a server configuration issue as this works in dev on my other projects.

Ideas?






Theme © iAndrew 2016 - Forum software by © MyBB