[eluser]entropy[/eluser]
I have a big problem with making a form work.
I use a controller to handle a registration request. When I strip de controller down to this:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Register extends CI_Controller {
public function index() {
$this->load->view('top');
$this->load->helper('form');
$this->load->view('end');
}
}
?>
the 'top' and 'end' views are neatly shown. But when I make a start with showing a form:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Register extends CI_Controller {
public function index() {
$this->load->view('top');
$this->load->helper('form');
echo form_open('register/confirm');
$data = array(
'name' => 'username',
'id' => 'username',
'value' => '',
'maxlength' => '40',
'size' => '40'
);
echo form_input($data);
$this->load->view('end');
}
}
?>
CI then places the form and input field at the very top of the html, even before the <html> tag.
It seems to me that making a form with the form helper is just impossible. Either that, or else: What am I doing wrong?