Pass the SEF'ed URL into php?
- andyweb
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
17 years 10 months ago - 17 years 10 months ago #814
by andyweb
Hi, I was wondering if there was any way I could pass the SEF version of the URL into PHP? (I have a php script included in the index.php template file)
Using "sefRelToAbs($_SERVER);" only gets me the "dirty URL" unless I have defined an alias.
Thanks
Using "sefRelToAbs($_SERVER);" only gets me the "dirty URL" unless I have defined an alias.
Thanks
Last Edit: 17 years 10 months ago by andyweb.
Please Log in or Create an account to join the conversation.
- Saka
-
- Offline
- Administrator
-
17 years 10 months ago #816
by Saka
Emir Sakic
www.sakic.net
sefRelToAbs( substr( $_SERVER), 1, strlen($_SERVER)-1 ) ); should work if Joomla is installed in root.
Emir Sakic
www.sakic.net
Please Log in or Create an account to join the conversation.
- andyweb
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
17 years 10 months ago #818
by andyweb
Thanks, but echo'ing that returns nothing, hrmmm. My joomla is installed in the root.
Excuse my ignorance ...but I don't quite understand how that code would help any though.
Thing is I don't want to return the, eg: /index.php?option=com_content&task=view&id=8&Itemid=23
I'd like to return the SEF'ed version of the URL, eg. /section/category/page-name.html
Is this possible?
PS. I noticed there seemed to be an extra bracket in there, so removed one at the end as the page was breaking at that point.
Excuse my ignorance ...but I don't quite understand how that code would help any though.
Thing is I don't want to return the, eg: /index.php?option=com_content&task=view&id=8&Itemid=23
I'd like to return the SEF'ed version of the URL, eg. /section/category/page-name.html
Is this possible?
PS. I noticed there seemed to be an extra bracket in there, so removed one at the end as the page was breaking at that point.
Please Log in or Create an account to join the conversation.
- andyweb
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
17 years 10 months ago #839
by andyweb
Well not to worry, I got it ...the command I was after was:
sefRelToAbs($_SERVER);
sefRelToAbs($_SERVER);
Please Log in or Create an account to join the conversation.
- it-info
-
- Offline
- New Member
-
Less
More
- Thank you received: 0
17 years 10 months ago #847
by it-info
Regards, Christian
Where to put htis an what are the benefits?Well not to worry, I got it ...the command I was after was:
sefRelToAbs($_SERVER);
Regards, Christian
Please Log in or Create an account to join the conversation.
- andyweb
-
Topic Author
- Offline
- New Member
-
Less
More
- Thank you received: 0
17 years 10 months ago #860
by andyweb
Well, I was using this to serve specific banners to the various sections I have on my website.
So I was pulling the sef url, then using the explode function in php to extract the section name and using that name to serve the specific banner I wanted.
I'm sure there can be many uses for it...
So I was pulling the sef url, then using the explode function in php to extract the section name and using that name to serve the specific banner I wanted.
I'm sure there can be many uses for it...
Please Log in or Create an account to join the conversation.