hi everybody! i hope someone's going to be able to help me with this question. i use the HTTP_REFERER to get the path of the last page (something like: http://www.something.de/Ordner/page) but i need a way to get only the path like http://www.something.de/Ordner/. is there a way to do that? thanks for any help katrin -- --------------------------------------------------------- The Truth Is Out There --------------------------------------------------------- katrin kirchner phone: 0 30 / 85 73 18 95 or 0 30 / 8 54 92 61 fax: 0 30 / 85 73 18 96 e-mail: katrin@beehive.de or kirchner2@aol.com ---------------------------------------------------------
On Fri, 30 Jul 1999, Katrin wrote:
i use the HTTP_REFERER to get the path of the last page (something like: http://www.something.de/Ordner/page) but i need a way to get only the path like http://www.something.de/Ordner/. is there a way to do that?
An easy way is to use Python's os.path sevices (assuming you just want to slice off the last path element). Untested... import os.path path = os.path.dirname("http://www.something.de/Ordner/page"[6:]) The [6:] uses Python string spliting to chop off the http:/ bit which may cause problems. Cheers, Anthony Pfrunder Zope Community Development Partner
On Fri, 30 Jul 1999, Katrin wrote:
i use the HTTP_REFERER to get the path of the last page (something like: http://www.something.de/Ordner/page) but i need a way to get only the path like http://www.something.de/Ordner/. is there a way to do that?
<dtml-var "_.string.join(_.string.split(HTTP_REFERER,'/')[:-1],'/')"> Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +54/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA
participants (3)
-
Andreas Kostyrka -
Anthony Pfrunder -
Katrin