0

HI I have a codeigniter controller called CIcontroller and I have a method say redirectmethod

in the redirectmethod i have some code and then i do this

$data['redirect_page'] = 'page_name';
$this->load->view('template_view',$data);

the template view basically loads header footer and the corresponding view as specified by the data parameter

Now everything works fine but my url has value http:\\blabla\CIcontroller\redirectmethod instead of http:\\blabla\page_name

could anyone help me fix this thing

1 Answer 1

2

You need to emit a Location header to tell the browser to load a different page. See redirect in the url helper.

Sign up to request clarification or add additional context in comments.

2 Comments

could I pass data with redirect like redirect('template_view', $data)
No, but you could serialize the object and keep it in a session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.