duandai2178 2015-09-21 08:56
浏览 63

OpenCart URL重定向,查询字符串不起作用

Hoping someone might be able to give me hand with this one.

I'm working on a customer account area on an OpenCart site and there's a section where people can delete pets they have added to their inventory. The delete functionality works and the so does the redirect, but I would like it so that a message shows in a box to confirm that the pet was successfully removed, like it does when one is added. To achieve this I've added a query parameter of "remove=1" into the URL redirect as per the OpenCart documentation but it does not seem to work.

Here is the code in the controller:

    $this->load->model('account/pet');

    $pet_info = $this->model_account_pet->removePet($this->request->get['pet_id']);
    if (!isset($pet_info['pet_id'])) {
        $this->redirect($this->url->link('account/pets', '', 'SSL'));
    }

    $this->redirect($this->url->link('account/pets', 'remove=1', 'SSL'));

But when it redirects, the query string doesn't appear and therefore the message does not show.

Any help appreciated,

Michael

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号