• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
redirect doesn't work

#1
[eluser]max123[/eluser]
function add_vacancy()
{
$this->load->helper('url');
$this->load->model('officer/officer_vacancy');
$user['user_id'] = $this->session->userdata('email');
$user['user_group'] = $this->redux_auth_model->getUserGroupByUserId($user['user_id']);
echo $new_user_id = $this->officer_vacancy->create_new_user($user);

redirect('/officer/officer_vacancy/new_vacancy', 'refresh');
}

This is my function. 'officer' is the sub folder inside the controller folder. Following is the error

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\Mycareergate3\system\application\controllers\officer\home.php:17)

Filename: helpers/url_helper.php

Line Number: 528

Please help me to solve this problem

#2
[eluser]flaky[/eluser]
do not echo if you want to redirect, remove the echo
Code:
echo $new_user_id = $this->officer_vacancy->create_new_user($user);

#3
[eluser]max123[/eluser]
Thank you so much flaky. I was struggling for hours to solve this. May god bless you. I would hug you if you were close by me. Thanx Thanx Thanx alot

#4
[eluser]flaky[/eluser]
ahhahaah
no problemo
glad I could help


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.