[eluser]adityajoshi[/eluser]
my view is some thing like this
form action="http://localhost/version-2/add/collect" method="post" id = "1" class="def-form">
<div class="section">
<div class="row">
<label class="main-label">What</label>
<input type="text" name = "event" id="autocomplete" class="field" />
</div>
<?php
echo form_open_multipart('gallery');
echo form_upload('userfile');
echo form_submit('upload', 'Upload');
echo form_close();
?>
<input type="submit" class="main-btn" value="Add Event" />
<div class="cl"> </div>
</form>
my controller is
<?php
var_dump($_POST);
class Add extends Controller{
public function __construct() {
parent::Controller();
$this->load->helper(array('form','url'));
$this->load->library('form_validation');
}
function index() {
$this->load->view('add_form');
}
function collect()
{
echo("checkpoint0");
$this->load->model('Gallery_model');
if ($this->input->post('upload')) {
echo("checkpoint1");
$this->Gallery_model->do_upload();
}
$data['images'] = $this->Gallery_model->get_images();
$this->load->view('gallery', $data);
}
my model is
<?php
var_dump($_POST);
class Gallery extends Controller {
function index() {
$this->load->model('Gallery_model');
if ($this->input->post('upload')) {
$this->Gallery_model->do_upload();
}
$data['images'] = $this->Gallery_model->get_images();
$this->load->view('gallery', $data);
}
}
some how it doesn't work had spent two days but still struck any help will be highly appreciated