Welcome Guest, Not a member yet? Register   Sign In
Wrong path after using a method/function and pagination
#1

[eluser]Unknown[/eluser]
i have just create some simple insert function
for example item_color_control/insert .... sth like that
Before i use a function, all path in my website are correct

http://127.0.0.1/collection/index.php/it...r_control/ sth like this

after i use a function, when i try to move to other page, the path will become

http://127.0.0.1/collection/index.php/it...ze_control

but the actual path i want to move is
http://127.0.0.1/collection/index.php/item_size_control

It seems that the path will just add to the last of the page

are there any solution for me?

Update:
Also same problem in pagination , although i use redirect and refresh to solve the above problem,
it still same in pagination
the path will become sth like this,
it would not change the whole path and just added to the last of the path

http://127.0.0.1/collection/index.php/it...ze_control
#2

[eluser]Magnificent Ronin[/eluser]
I had the same issue, resolved it using base_url() instead of the full path.
#3

[eluser]Unknown[/eluser]
i have modify the code

Code:
public function insert() {
        $this->load->model('item_model');

        $this->item_model->insertType();
        redirect('/item_type_control/', 'refresh');
    }

i use redirect to sth and use refresh after insert, the problem seems solved.
But if i use pagination, the problem still occurs,
the path will become xxxx/index.php/xxxx/page/n/other_controller




Theme © iAndrew 2016 - Forum software by © MyBB