|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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? |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Only when a user is not logged in. When a user logs in, the form.login disappears. Allthough the code is still there
|
|
#4
|
|||
|
|||
|
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.
|
|
#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
|
|
#6
|
|||
|
|||
|
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?
|
|
#7
|
|||
|
|||
|
Got it - some other codes that changed the login data. Its all running now
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Identify Buttons |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|