Copy link to clipboard
Copied
This might sound a bit strange but I have a system running that serves ads from a variety of sources. The problem is that I need to append a UUID inside the string called from the database.
<cfoutput>
#ad_details#
</cfoutput>
The variable called from the query outputs as:
<SCRIPT language='JavaScript1.1' SRC="http://adserverlink#CreateUUID()#">
</SCRIPT>
The problem is that it outputs the CreateUUID as seen above and not as the expected output of a UUID.
Hope that makes sense.
Thanks in advance.
Copy link to clipboard
Copied
You can't simply output a string and expect it to execute!
You will need to write your string to a file, then INCLUDE it, rather than just output it.
Do a search on these forums (perhaps best to do it via Google than the inbuilt forum search) for "code in variable" or "dynamic code" or "evaluate" and read some of the threads discussing this: this crops up every six months or so, so there should be good discussions on it.
--
Adam
Copy link to clipboard
Copied
It might be easier if the UUID was a url variable instead of the actual url.
Copy link to clipboard
Copied
ColdFusion's implementation of UUID is slightly different, use this function to generate a SQL-Server like one...
<cffunction name="MicrosoftUUID" access="public" output="false">
<cfreturn insert("-", CreateUUID(), 23) />
</cffunction>
Copy link to clipboard
Copied
AvalancheWHO wrote:
The variable called from the query outputs as:
<SCRIPT language='JavaScript1.1' SRC="http://adserverlink#CreateUUID()#">
</SCRIPT>
The problem is that it outputs the CreateUUID as seen above and not as the expected output of a UUID.
<cfoutput><SCRIPT type="text/javascript" language='JavaScript1.1' SRC="http://adserverlink#CreateUUID()#">
</SCRIPT></cfoutput>
Copy link to clipboard
Copied
AvalancheWHO wrote:
This might sound a bit strange but I have a system running that serves ads from a variety of sources. The problem is that I need to append a UUID inside the string called from the database.
...The problem is that it outputs the CreateUUID as seen above and not as the expected output of a UUID.
Go back to the place where you intended to insert the UUID to the database. Yoy will find that you inserted the string #CreateUUID()# instead of the string <cfoutput>#CreateUUID()#</cfoutput>