create new tag
, view all tags
New feature: A TWiki-based application that composes a URL with parameters needs to encode the URL string.

Documented in TWikiVariables:

%URLENCODE{"string"}% Encodes a string for use as a URL parameter. Ex: %URLENCODE{"spaced name"}% returns spaced%20name

In TWikiAlphaRelease and TWiki.org.

-- PeterThoeny - 17 May 2002

Pardon my ignorance, but where would this be used? Sorry for the late question...

-- StewStryker - 13 Aug 2002

One example of using this would be passing a spaced string to another page as a parameter, e.g. [[http://twiki.org/cgi-bin/view/Sandbox/RichardsPage?foo=hi%20there test link with parameter 'foo']] would generate test link with parameter 'foo'. This could be used to drive a CGI program, or if it's a TWiki page you could use %URLPARAM to embed the parameter wherever needed (which is what I've done in this example. Since the parameter could (probably) come from a form or a variable, this is quite flexible.

This would also be useful in passing in a subject line for a mailto: link when using EmailThisPageLink.

Peter probably has a more real-world example!

-- RichardDonkin - 17 Aug 2002

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2005-02-15 - SamHasler
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.