GSAK (Geocaching Swiss Army Knife)
Contents - Index

HttpEncode (function)

HttpEncode(sData) : string

When using Custom URL links or the new URI feature the data in the generated links should be HttpEncoded otherwise special characters can cause problems. For example, the waypoint code "home" (including double quotes) should never appear in a <Href> link in this native form because the double quotes are not allowed. Instead, the HTML link should be HttpEncoded so that your HTML code shows this data as %22home%22

The HttpEncode() function has been introduced for Macro writers that are generating their own HTML code and should be used when ever you dynamically build a <HREF> link - especially if you are using GSAK database variables to build URI action links.

For example, the following code would be the recommended way of generating a "Flag Toggle" URI link action.
 

$href = "<a href=" + quote("gsak://%FF/flagtoggle/" +  HttpEncode($d_Code) + "/" + HttpEncode($_CurrentDatabase)) + ">Toggle GSAK User Flag</a>"


Alpha List         Category List

Copyright 2004-2019 CWE Computer Services  
Privacy Policy Contact