URLHash(URLValue)
Last updated January 7, 2002
Version: 1 | Requires: ColdFusion 5 | Library: SecurityLib
Description:
This function generates a Hash value based off of the full URL including any URL variables and the remote user's IP address.
You can use the URLCheckHash UDF to determine if the URL was changed.
Return Values:
Returns a string.
Example:
<cfset urlData="id=#X#&mode=display">
<cfoutput>
Hashed URL is:<br>
display.cfm?#URLHash(urlData)#
</cfoutput>
Parameters:
| Name | Description | Required |
|---|---|---|
| URLValue | The string to hash. | Yes |
Full UDF Source:
<cfscript>
/**
* URL Security tool to prevent a user from changing any part of a URL.
*
* @param URLValue The string to hash.
* @return Returns a string.
* @author John Bartlett (jbartlett@strangejourney.com)
* @version 1, January 7, 2002
*/
function URLHash(URLValue)
{
var HashData =cgi.Server_Name & cgi.Remote_Addr & cgi.Script_Name & URLValue;
return URLValue & "&hash=" & LCase(Hash(HashData));
}
</cfscript>
Search CFLib.org
Latest Additions
Tayo Akinmade added
arrayTrim
4 day(s) ago
Will Belden added
longTime
9 day(s) ago
James Sleeman added
quickSort
19 day(s) ago
Ben Forta added
GetHostAddress
22 day(s) ago
Top Rated
EksporSQLData
Rated 5.0, 16 time(s)
backupDatabase
Rated 5.0, 13 time(s)
indentXml
Rated 5.0, 10 time(s)
generateSsccAsn
Rated 5.0, 4 time(s)