cfml

Facebook OAuthException - This authorization code has expired. [code=100]

笑着哭i 提交于 2019-12-11 07:09:52
问题 I have setup the Facebook API SDK for ColdFusion - https://github.com/affinitiz/facebook-cf-sdk I've setup a login process which works successfully but after 10 minutes or so when I return and refresh the page, it shows the following error: This authorization code has expired. [code=100] Is there something I am missing with the FB login? Am I meant to be checking against something manually in order to persist the session? Cheers Shaun <cfscript> import facebook.sdk.FacebookApp; import

Trying to convert JSON HTTP post to CFHTTP post

孤街浪徒 提交于 2019-12-11 05:45:49
问题 I am trying to properly code a call to the Firebase Cloud Messaging REST API though CFHTTP, by recreating the output of successful Firebase console post. Below is what the console states is the proper code POST /fcm/send HTTP/1.1 Host: fcm.googleapis.com Content-Type: application/json Authorization: key=AIzcXE cache-control: no-cache { "to": "e5kpn8h9bR95NuXVHTOi50bCURG0BS4S6ccUm3X5q", "priority": "high", "notification" : { "title": "", "body" : "This is the actual message content", "sound":

Cannot find qryname14411 key in structure

独自空忆成欢 提交于 2019-12-11 05:44:55
问题 I have an error that seems to be associated with <cfscript> db operation // traffic tracking myQry = new Query(); myQry.setSQL("INSERT INTO dbo.Traffic (Circuit, Fuseaction, IP_hash) VALUES (:circuit, :fuseaction, :ip_hash)"); myQry.addParam(name="circuit", value="#listfirst(rc.fuseaction, '.')#", cfsqltype="CF_SQL_VARCHAR"); myQry.addParam(name="fuseaction", value="#listlast(rc.fuseaction, '.')#", cfsqltype="CF_SQL_VARCHAR"); myQry.addParam(name="ip_hash", value="#cgi.remote_addr#",

ColdFusion Variable Name with brackets

风格不统一 提交于 2019-12-11 00:47:28
问题 I'm interacting with a webhook which provides a FORM struct with several variables containing brackets [ ] . How can I utilize these variables within CFML? Example: FORM.PAYLOAD[SITE][ID] FORM is the struct PAYLOAD[SITE][ID] is the name of the variable within the FORM struct. All help is greatly appreciated! 回答1: I would rather suggest you to dump the form struct using cfdump like this- <cfdump var = "#form#" /> and see if PAYLOAD[SITE][ID] is a key of form struct or only payload is the key.

Why are certain characters not being injected correctly to SQL Server from a CFQUERY?

心不动则不痛 提交于 2019-12-10 19:39:35
问题 I have a Coldfusion app running on Lucee which connects to a SQL Server database. When I run the following query directly in SQL Server Manager: UPDATE article SET content='20m²' WHERE id=3159 The column gets populated fine with 20m². HOWEVER, when run from a cfml page which simply runs this: UPDATE article SET content='20m²' WHERE id=3159 The column gets populated with: 20m² As in, this additional  character appears. This also occurs with some other special characters, but most are fine.

Is ColdFusion evaluate() really dangerous?

梦想的初衷 提交于 2019-12-10 18:16:41
问题 Upon reading https://stackoverflow.com/review/first-posts/3429940 (is PHP eval() really dangerous?) And http://dhorrigan.com/post/30395987906/is-eval-really-evil-yes-and-no I am wondering if the ColdFusion equivalent has similar issues. 回答1: I think the warnings on the PHP function are histrionic & a bit facile, because they focus on one specific misuse of the construct, rather than its general purpose. evaluate() will be less prone to this because it cannot execute any amount of code, it can

Coldfusion RESTful webservice: Object is not an instance of declaring class

白昼怎懂夜的黑 提交于 2019-12-10 13:47:13
问题 When I call the URL http://192.168.2.26:8080/rest/RestSample/season/1.json I get the error: "Error","ajp-bio-8012-exec-4","03/01/13","16:51:58","RestSample","object is not an instance of declaring class The specific sequence of files included or processed is: C:\path_to\api\service.cfc'' " This is the /api/service.cfc file: <cfscript> component restpath="season" rest="true" { remote query function getSeasonsByUserId(numeric userid restargsource="Path") httpmethod="GET" restpath="{userid}" {

Convert coldfusion json to struct

天大地大妈咪最大 提交于 2019-12-09 17:10:23
问题 I have a JSON variable output from a jQuery application as so: [{"id":1}, {"id":197,"children":[{"id":198},{"id":199},{"id":200}]}, {"id":2,"children":[{"id":3},{"id":4},{"id":143},{"id":6},{"id":5},{"id":7},{"id":8},{"id":9},{"id":10},{"id":11},{"id":12}]}, {"id":15,"children":[{"id":17},{"id":190},{"id":191},{"id":131},{"id":16},{"id":142},{"id":124}]}, {"id":149,"children":[{"id":150},{"id":160},{"id":161},{"id":184}]}, {"id":20,"children":[{"id":132},{"id":127},{"id":152},{"id":107},{"id"

Is using cfsqltype good practice?

耗尽温柔 提交于 2019-12-08 17:00:33
问题 When coding a cfqueryparam or cfprocparam, cfsqltype is optional. However, I've usually seen it coded. Are there any benefits to specifying cfsqltype? 回答1: The main benefit is an additional level of sanity checking for your query inputs, prior to passing it into your query. Also, in the case of date time values, I believe CF will properly translate datetime strings into the proper database format, if the cfsqltype="CF_SQL_DATE" or ="CF_SQL_TIMESTAMP" is specified. In addition, I think it

How would you go about executing a database query based on the value from a form select element?

假装没事ソ 提交于 2019-12-08 15:58:32
问题 I am using ColdFusion as my application server and SQL Server for the database. I have a select form element which lists a number of vehicles: Volvo S60 , BMW M6 , VW Jetta . Based on what vehicle the user selects, I need my webpage to perform a database query to find out what 'type' of vehicle they selected e.g. SUV, Coupe, Convertible. Depending on what 'type' is returned from the database, the database will return a list of options suitable for that vehicle type. My database tables can do