Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Support / [solved] Problem with cot_url

tensh
#1 2012-11-23 09:30


Contributors
Thanked: 9 times

Hi;

The following code:

 

header('Location: '.cot_url('plug', 'e=offer&s=details&id='.$offid));
header('Location: '.cot_url('plug', array('e' => 'offer', 's' => 'details', 'id' => $offid)));

gives me urls with /offer?s=details&id=14 - which don't work.
 
When I use: header('Location: index.php?e=offer&s=details&id='.$offid); - then it works.
 
What am I doing wrong?
 
I also have problem with AJAX urls like admin/config#get;n=edit&o=plug&p=html (should be admin/config?n=edit&o=plug&p=html) - they also don't work at all.
 
Any help please?

 


This post was edited by tensh (2012-12-06 09:04, 2 years ago)
Alex300 Online
#2 2012-11-23 09:49


Team
Thanked: 37 times

try this:

cot_redirect(cot_url('plug', array('e' => 'offer', 's' => 'details', 'id' => $offid), '', true));

It should work

сot_url() fourth parameter must be 'TRUE' for redirects.

Приходится бежать со всех ног, чтобы только оставаться на месте. А чтобы куда-то попасть, приходится бежать еще быстрее...
...Sorry for my english...
Portal30.Ru
tensh
#3 2012-11-23 12:46


Contributors
Thanked: 9 times

Thank you very much, works like a charm :)