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

tensh
#1 23. November 2012, 09:30

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?

 


Dieser Beitrag wurde von tensh (am 6. Dezember 2012, 09:04, vor 11 Jahre) bearbeitet
Alex300
#2 23. November 2012, 09:49

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...
Бесплатные расширения для Cotonti: https://lily-software.com/free-scripts/
tensh
#3 23. November 2012, 12:46

Thank you very much, works like a charm :)