Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form variable - pls help

Status
Not open for further replies.

esprit

Technical User
Dec 14, 2001
3
FR
i know this subject seems too easy but this prob is driving me nuts. i think i had everything covered, but my action-page just keeps saying there is an error (error resolving parameter form.email).

e.g.
form page
*********
<cfform action=&quot;process.cfm&quot; method=&quot;post&quot;> etc...
<cfinput name=&quot;email&quot; maxlength etc...>


process page
************
<cfoutput>#form.email#</cfoutput>

where else could i have gone wrong?? i checked the books and did exactly what they say..
 
I would recommend not using <cfform> and <cfinput> unless you really need to.

Try this,

<form method=&quot;post&quot; action=&quot;process.cfm&quot;>
<input type=&quot;text&quot; name=&quot;email&quot;>
</form>

If this still generates an error, change method=&quot;post&quot; to method=&quot;get&quot;. This will cause the variable email to be sent as a url variable and you can see it in your location box. This will ensure that the process.cfm script actually gets the variable. If you have some type of re-direct going on, it could be that your form variable gets posted to an intermediary script which re-directs back to the process.cfm script. If you use the action=&quot;get&quot;, you'll be able to see if the variables are actually making it to the process.cfm script. In this case, you will need to reference it as #url.email# but if it shows up in the url string, it should be available to the script.

Once you fix the problem, you can then change it back to method=&quot;post&quot; which is the preferred method.

Let me know what happens,
GJ
 
thanks GJ. actually, i tried that and it doesn't work either. is coldfusion always like this? now i am using session variable. even now, the page seems to work fine one moment, the next, it states that there is some kinda error in the code. sigh~
 
What happened when you changed the method to &quot;get&quot; and the &quot;form.&quot; to &quot;url.&quot;? Actually CF is usually enjoyable to work with, it's just those initial hurdles that can be frustrating :)

GJ
 
hi GJ,

since i changed to using session variables now, can i ask you a question re. this var?
i only have to declare the var. once and i can use it thruout my app, right? how come the error msg says that the var is either not created, misspelled, or has time out? i have already set the var last for 2 days b4 timeout in the CF Administrator.

thanks.
 
enable session variables in the cfapplication
as well in the cf server
and don't forget to pass the cfid and cftoken to each page
 
Hi esprit,

Do all of your pages share the same application.cfm page? You will want to make sure your <cfapplication> tag is in a shared application.cfm file. As iza mentions, make sure you pass the cfid &amp; cftoken via url variables in any link or form. This ensures your app will work even if the visitor has cookies disabled.

GJ
 
thanks iza and GJ for the prompt reply...really grateful :)
you are gonna need loads of patience with my Qs..

whaddya mean by &quot;Do all of your pages share the same application.cfm page?&quot; u mean do i declare <cfapplication=&quot;app&quot; sessionmanagement=yes> on every page? i do that.

how do i pass the cfid &amp; cftoken via url variables in any link or form? i am only running the program on my pc, so is there a need for this?

sometimes the error states that my session variable is not declared on that certain line- but there is no such usage of the var in that particular line.. what does it mean?

thanks again. i am actually rushing towards a deadline for my final year project, so i really appreciate all your help.. :)
 
-> the application.cfm file is included implicitly in every page on the folder where it is (and subfolders ... in case there's no other application.cfm in them) -- the doc is very clear on that subject and it won't hurt you to read it
-> so you don't need to add the <cfapplication> tag in every page, only in the application.cfm one
-> if you don't use any kind of server you won't be able to use session variables !
-> passing parameters from page to page is also a basic html stuff, and here as well you should read the doc. There are basically 2 ways : embed them in the url ( or pass them as hidden fields thru forms

in your school you're learning to code without learning the language first, and without having the docs ???? sounds like a tough learning ... ;-)
 
hi iza,

actually, i did read the docs, but it seems like even when i do as instructed, but the results are different.

i already have the application.cfm file (the content of which is just the <cfapplication> tag, right?

i run my prog on the personal web server.

thanks.
 
the name of the file should be &quot;Application.cfm&quot; (with A not a) - basically, you write in it what you need on every page, such as authentication (this is the example given in cf doc). So if you only need the cfapplication tag, it's fine.
you have to tranform all your links so that they look like this : yourdomain.com/yourpage.cfm?cfid=#cfid#&amp;cftoken=#cftoken#
don't forget to enclose this between <cfoutput>
let me know
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top