Welcome Guest, Not a member yet? Register   Sign In
Pass variable in url on form submit
#1

[eluser]Wonder Woman[/eluser]
Hi,

I have an edit url set up so that the article id is appended on the end, however when I got to submit the form it doesn't work because I can't append this variable on the end.

View:
Code:
echo anchor('admin/pages/edit/'.$page->id, 'Edit');

Controller:

function edit($page_id)
Code:
{
    $this->session->set_userdata('page_id', $page_id);
    $data['page_id'] = $this->session->userdata('page_id');
    $this->form_validation->set_rules('content','content','trim|required|htmlspecialchars');
    $this->form_validation->set_error_delimiters('<p class="error">* ','</p>');
    
    if($this->form_validation->run() == FALSE){
        $this->load->view('admin/pages/edit', $data);
    } else {            
        redirect('admin/pages/edit', $data);
    }
}

How can I do it so that the page will submit and go back to 'admin/pages/edit/1', for example.

Many thanks in advance.


Messages In This Thread
Pass variable in url on form submit - by El Forum - 05-16-2011, 04:43 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 04:51 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 04:54 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 04:55 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 04:57 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 05:00 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 05:00 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 05:02 AM
Pass variable in url on form submit - by El Forum - 05-16-2011, 05:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB