We help IT Professionals succeed at work.
Get Started

Element INCIDENT is undefined in FORM

189 Views
Last Modified: 2015-03-01
Im trying to send $_POST data from my App to my CF site... after some reading I'm under the impression that form. is the equivalent of $_POST .... i keep getting the above error ... but when I hard code the data  on the datatransfer.cfm page it works ... leading me to believe my site is block the apps access (session.allow= true) or this is the wrong way to send data to coldfusion ... any guidance would be appreciated ... thanks

the app sending

payload = {'Incident' :Incident,'Ic_number':Ic_number,'Last_Name':Last_Name, 'First_Name':First_Name}
headers = {'content-type': 'application/x-www-form-urlencoded'}
r = requests.post("http://xxxx.com/datatransfer.cfm", data=payload)

Open in new window


Coldfusion form xxxxx.datatransfer.cfm

<cfset  session.allowin = "true">
<cfset incident_number = #form.Incident#>
<cfset active_incident_number = #form.Ic_number#>
<cfset lastname = #form.Last_Name#>
<cfset firstname = #form.First_Name#>

Open in new window


Application Page

<!--- Create the application --->
   <cfapplication name="xxxxxx"
   	clientmanagement="Yes"
       sessionmanagement="Yes"
       sessiontimeout="#CreateTimeSpan(0,0,15,0)#"
       applicationtimeout="#CreateTimeSpan(0,2,0,0)#" />
   
   <!--- Now define that this user is logged out by default --->
   <CFPARAM NAME="session.allowin" DEFAULT="false" />
   
   <!--- Now define this user id to zero by default, this will be used later on to access specific information about this user. --->
   <CFPARAM NAME="session.user_id" DEFAULT="0" />
   
   <!--- Now if the variable "session.allowin" does not equal true, send user to the login page --->
   <!--- the other thing you must check for is if the page calling this application.cfm is the "login.cfm" page and the "Login_process.cfm" page since the Application.cfm is always called, if this is not checked the application will simply Loop over and over. To check that, you do the following call --->
   
   <cfif session.allowin neq "true">
   	<cfif  ListLast(CGI.SCRIPT_NAME, "/") EQ "login.cfm">
       <cfelseif ListLast(CGI.SCRIPT_NAME, "/") EQ "login_process.cfm">
       <cfelse>
       	<!--- this user is not logged in, alert user and redirect to the login.cfm page --->
           <script>
           	alert("You must login to access this area!");
               self.location="login.cfm";
           </script>
       </cfif>
   </cfif>
   

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE