ewel
11-18-2007, 09:27 PM
I have pages (created by a php file) in which I want to display the url of other pages, and links to that url.
The url's are very similar. The url of the pages I have is (with varying numbers):
http://mydomain.com/index2.php?option=com_content&task=view&id=1&pop=1&page=0&Itemid=1
The url I want to display and link to is (with corresponding id number):
http://mydomain.com/index.php?option=com_content&task=view&id=1
In other words, I would like to have a bit of php code that takes the current url and strips out the '2' after "index" and strips '&pop=1&page=0&Itemid=1' out from after "&id=1". Then I can (hopefully) take the resulting url as value from that code to create a link echoing the value as location and as text. To clarify, and this may complicate things, I would like this script to work in all pages and therefore regardless of what the number of the id, pop, page or itemid is in the url.
Unfortunately I have no clue how to do this. Is there anyone who could help me write this bit of php code?
This would realy help me, so many many thanks in advance!
The url's are very similar. The url of the pages I have is (with varying numbers):
http://mydomain.com/index2.php?option=com_content&task=view&id=1&pop=1&page=0&Itemid=1
The url I want to display and link to is (with corresponding id number):
http://mydomain.com/index.php?option=com_content&task=view&id=1
In other words, I would like to have a bit of php code that takes the current url and strips out the '2' after "index" and strips '&pop=1&page=0&Itemid=1' out from after "&id=1". Then I can (hopefully) take the resulting url as value from that code to create a link echoing the value as location and as text. To clarify, and this may complicate things, I would like this script to work in all pages and therefore regardless of what the number of the id, pop, page or itemid is in the url.
Unfortunately I have no clue how to do this. Is there anyone who could help me write this bit of php code?
This would realy help me, so many many thanks in advance!