09-28-2018, 06:03 AM
im trying to go from mysite.com/signin/1 to mysite.com/course/enroll/1
but after validation_run() the segments just goes away.
i kept on being redirected to mysite.com/student even tho course_id is not empty.
right now, i just used session to get around this problem but i know that is not an efficient solution.
but after validation_run() the segments just goes away.
PHP Code:
public function signin(course_id=null) {
if(!$this->form_validation->run()){
// wrong input
}
else{
if(!empty($course_id)) {
redirect(base_url('course/enroll/'.$course_id));
}
else {
redirect(base_url('student'));
}
}
}
i kept on being redirected to mysite.com/student even tho course_id is not empty.
right now, i just used session to get around this problem but i know that is not an efficient solution.