ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 21st, 2004, 12:25 PM
Evilfish Evilfish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Denmark, Copenhagen
Posts: 57 Evilfish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 7 m 8 sec
Reputation Power: 5
Identify Buttons

I have a form, which i made a code to. An of cause the code must only be executed when the submit button is pressed. The code looks like this:

<cfif IsDefined("FORM.login") AND FORM.login EQ "yes" AND Session.settings_accesslevel EQ 0><br>
<cfquery name="getuserinfo" datasource="Evilfis_db">
SELECT *
FROM users
WHERE username = '<cfoutput>#FORM.userlogin#</cfoutput>'
</cfquery>
<cfset user = #getuserinfo.username#>
<cfset pass = #getuserinfo.password#>
<cfif #user# EQ #FORM.userlogin# AND pass EQ #FORM.passlogin#>
<cfset Session.settings_name = #getuserinfo.username#>
<cfset Session.settings_accesslevel = #getuserinfo.acceslevel#>
<cfelse>
<cfset loginnote = "<BR>Wrong username or password">
</cfif>

This code is called in on everypage at my homepage. It works fine, but when i change page within the site, the code activates without the submit button is pressed. I guess the problem is with this code:

<cfif IsDefined("FORM.login") AND FORM.login EQ "yes" AND Session.settings_accesslevel EQ 0>

Can you see the problem?

Reply With Quote
  #2  
Old July 21st, 2004, 02:05 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
I don't see any problem. Is form.login defined on every page?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old July 21st, 2004, 02:44 PM
Evilfish Evilfish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Denmark, Copenhagen
Posts: 57 Evilfish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 7 m 8 sec
Reputation Power: 5
Only when a user is not logged in. When a user logs in, the form.login disappears. Allthough the code is still there

Reply With Quote
  #4  
Old July 21st, 2004, 03:03 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Isn't that what you want? The login form is there if the user is not logged in, and if they are logged in, the login form is not displayed. I guess it's not clear what you are trying to do.

Reply With Quote
  #5  
Old July 23rd, 2004, 03:41 AM
Evilfish Evilfish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Denmark, Copenhagen
Posts: 57 Evilfish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 7 m 8 sec
Reputation Power: 5
It is what i want. but i cant keep the user online. Everytime i click a link on the page it log off the user

Reply With Quote
  #6  
Old July 23rd, 2004, 08:34 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Is the session variable persisting? Check the timeout of the session variables in the administrator or in your cfapplication tag. Can you create a simple example that just proves that you session variables are working correctly?

Reply With Quote
  #7  
Old July 27th, 2004, 12:48 PM
Evilfish Evilfish is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Location: Denmark, Copenhagen
Posts: 57 Evilfish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 7 m 8 sec
Reputation Power: 5
Got it - some other codes that changed the login data. Its all running now

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Identify Buttons


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway