Welcome Guest, Not a member yet? Register   Sign In
Validation for URL data submitted as POST or GET from external URL
#3

[eluser]Brian Loomis[/eluser]
So this is what my code looks like, trying to capture incoming requests and archive them and need to validate if they are valid or not.

class Incoming extends Controller {

function index()
{
parse_str($_SERVER['QUERY_STRING'],$_GET);
// checks for incoming requests:
// Post: http://www.xyz.com/incoming/?z=m&c=3&l=1...=344&f=122

$this->load->helper(array('form', 'url'));
$this->load->library('validation');
$rules['c'] = "required";
$rules['l'] = "required";
$rules['y'] = "required";
$rules['s'] = "required";
$rules['f'] = "required";

$this->validation->set_rules($rules);

$data['info']=$this->validation->run();

if ($this->validation->run() == FALSE)
{
$this->load->view('Incoming_fail',$data);
}
else
{
$data['c']=$this->input->get_post('c', TRUE);
$data['l']=$this->input->get_post('l', TRUE);
$data['y']=$this->input->get_post('y', TRUE);
$data['s']=$this->input->get_post('s', TRUE);
$data['f']=$this->input->get_post('f', TRUE);

$this->load->view('Incoming_index',$data);
}
}
}

So this always triggers that it is invalid, even when all my parameters are present.

What changes can I make to validate get requests instead of form posts?


Messages In This Thread
Validation for URL data submitted as POST or GET from external URL - by El Forum - 09-02-2010, 03:59 PM



Theme © iAndrew 2016 - Forum software by © MyBB