0

how can i pass value of textbox into code iginator controller after submit. i get Disallowed Key Characters message. i have array of controls.
or if you could provide some tips on how to get the posted values in controllers .
in view

<form method="post">
<input type="text" name="Insert['name']"/>
<input type="text" name="Insert['fname']"/>
<input type="submit" value="Insert"/>
</form>

in controller

<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');
class Helloworld extends CI_Controller {
	public function index() {
		$data['InsertedRecord']=$this->input->post('Insert['name']');
		
$this -> load -> view('helloworld', $data);
	}
}

regards,

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by diafol
0
('Insert['name']')

problem with quote:
try

("Insert['name']")

thanks for reply i passed that this way the quote is creating problem.

<input type="text" name="name[]"/>

then in controller i loop through array.

for($i=0;$i<count($_POST['name']);$i++) echo $_POST['name'][$i];
0

The point I was making is that having consecutive quotes (') in this case, leads to

post('Insert['name']');

changing to

post([B]'Insert['[/B](AND)name(AND)[B]']'[/B]);

The parameter passed will either be 'Insert or you'll hit an error.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.