Actually, I'm referring to the form-scoped variable called "form.fieldnames".  
It is a comma delimited list of all the form fields that were submitted.  This 
is more generic than looking for a specific fieldname.  But yes, you could do 
that too, although if you ever change your fieldname you would have to change 
the code again here.  Basically, the bottom line is that if the form is 
submitted, that variable will exist (of course as long as you have at least one 
form field being passed).  

If you are keeping your users from submitting the form more than once, then I 
think you would be better off storing that setting in a database so they 
couldn't submit the form from soneone else's machine as well.  In other words, 
save in a table the user's login id and a value like 'Questionnaire_Submitted' 
(BIT - yes/no field).  Then, no matter where they login from they can't submit 
the questionnaire again, and then if you issue a new questionnaire, you can 
just blow out that table so all users can submit the new one.  You could make 
it even more complicated with another table that tracks submission of EACH 
questionnaire, but you may not need to take it that far.  Anyway, if I'm trying 
to do what you're doing, I put it in a database, not a client variable, so that 
it persists across not only login sessions on one machine, but all machines 
that can access the application. 

Hope this helps.

Dave

-----Original Message-----
From: Ian Vaughan [mailto:[EMAIL PROTECTED]
Sent: Monday, July 25, 2005 9:47 AM
To: CF-Talk
Subject: RE: Restricting Access


Hi Dave

What I have is a questionnaire that I would like users (internal) to
only submit once.  If they have already submitted feedback and try to
access the page again they see the STOP! wording. If they have yet to
successfully submit a form then they view the page as normal.  The form
is question also uses perl for the processing.


So basically you are saying if I check for a form.fieldname that I know
will have a value I can use that to set the Client Variable

i.e.

 <cfif isDefined("form.EXAMPLEFORMFIELD")> 

   <cfset client.localip = #cgi.remote_addr#>

</cfif>

<cfif isDefined("client.localip") and client.localip EQ
#cgi.remote_addr# >
  STOP!
  <cfabort>
</cfif> 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 25 July 2005 14:24
To: CF-Talk
Subject: RE: Restricting Access

I'd look for 'form.fieldnames' like isDefined("form.fieldnames").
That's how I check for form submissions.  I hope this is what you're
looking for as I wasn't sure what you're asking.  If you are trying to
maintain this only during the current session, you shouldn't need to
worry about it because IP address won't change during the session.  It
sounds like you're trying to persist across session's however, so why
not just set a cookie on the person's machine that says they've
submitted the feedback form already (maybe that's what you're trying to
do with the client.localip).  

In any case, what if a different user uses that computer.  You don't
want them to be able to submit a feedback question also?  If your
concern is that you don't want the same person to submit a feedback
form, then I would tie it to their user account, not their IP address. 

I hope that helps.  I'm a bit confused myself. :-)

Dave

-----Original Message-----
From: Ian Vaughan [mailto:[EMAIL PROTECTED]
Sent: Monday, July 25, 2005 9:08 AM
To: CF-Talk
Subject: Restricting Access


I have the following code that supposed to check by their IP address if
a user has submitted a feedback form, if they have and try to visit the
page again they get STOP! If they have not submitted a form before they
see the form.

However how can I set the first line <cfif isDefined etc..  To set the
client.localip variable when the user has submitted the form ????

 <cfif isDefined("form.submit???????????")> 

   <cfset client.localip = #cgi.remote_addr#>

</cfif>

<cfif isDefined("client.localip") and client.localip EQ
#cgi.remote_addr# >
  STOP!
  <cfabort>
</cfif>










~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212727
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to