Controller
function delete_payment($payment_id) { $this->sale_lib->delete_payment($payment_id); $this->_reload(); }查看
<?php echo anchor("sales/delete_payment/$payment_id",'['.$this->lang->line('common_delete').']');?>$ payment_id可能类似礼品卡:1或礼品卡: 12345983984334
It is possible for $payment_id to be something like "Gift Card:1" or "Gift Card:12345983984334"
当它是礼品卡:1时,网址会自动解码,删除功能工作,当它是一个较长的字符串,如礼品卡:12345983984334不会解码。
When it is Gift Card:1 the url is automatically decoded and the delete function works, when it is a longer string such as Gift Card:12345983984334" the url is NOT decoded.
URLS是:
http://localhost/index.php/sales/delete_payment/Gift%20Card:1
http://localhost/index.php/sales/deletepayment / Gift%20Card:12345983984334
第一个不起作用,第二个不起作用
First one works, second one doesn't
推荐答案实际上,我只是试图在我的本地机器(WAMP在Windows 7)复制你的情况,你是对的我试图在所有主要的浏览器(FF4,IE9,Chrome)差异。
Actually, I just tried to replicate your situation on my local machine (WAMP on Windows 7) and you're right. I tried on all major browsers (FF4,IE9,Chrome) and saw no differences.
虽然这不能真正回答你的问题,你可以使用php函数 rawurldecode :
Although this doesn't really answers your question, you can always rig a workaround like this with php function rawurldecode:
function delete_payment($payment_id) { $decoded_id = rawurldecode($payment_id); $this->sale_lib->delete_payment($decoded_id); $this->_reload(); }这样,你的'id' c $ c>礼品卡:123456789 (我试过不同的lenghts和alwyas工作),准备好您的模型。
In this way you'll have your 'id' in the form Gift Card:123456789 (I tried with different lenghts and alwyas worked), ready for your model.
更多推荐
CodeIgnitor urlencode / decode
发布评论