Hello, i want to pass variables in url with slashes for example if the url is http://host.com/script/2008/05/05
the script would get 2008, 05 and 05 as variables (year,month,day)
i'm using mod_python/publisher.
Thanks in advance
Vibze 0 Newbie Poster
Recommended Answers
Jump to PostIf the script has access to the URL you could do something like:
>>> url_in = 'http://host.com/script/2008/05/05' >>> match_text = 'script/' >>> index = url_in.find(match_text) + len(match_text) >>> url_in[index:].split('/') ['2008', '05', '05'] >>>
Is that kind of what you …
Jump to Postjust url encode it.
import urllib res = urllib.quote(original) orginal = urllib.un_quote(res)
All 6 Replies
jlm699 320 Veteran Poster
scru 909 Posting Virtuoso Featured Poster
Vibze 0 Newbie Poster
woooee 814 Nearly a Posting Maven
jlm699 320 Veteran Poster
Schol-R-LEA 1,446 Commie Mutant Traitor Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.