EasyCFM.COM ColdFusion Forums / Coding Help! / "I can't build a decent Discussion Board blues"

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: "I can't build a decent Discussion Board blues" -- page: 1 2 3

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

cpink
02-29-2004 @ 11:10 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Feb 2004

I have tried to work with building a Discussion board over and over again and I can't quite figure out what it is I keep getting this error.........

The requested scope CLIENT has not been enabled.  
Before CLIENT variables can be used, the CLIENT state management system must be enabled using the CFAPPLICATION tag.  
  
The error occurred in /home/felton/fgkc-www/message/action.cfm: line 4

2 :      <CFINSERT DATASOURCE="fgkc_com" TABLENAME="tblUsers" FORMFIELDS="FirstName, LastName, Email, Username, Password">
3 :           <CFINCLUDE TEMPLATE="header.cfm">
4 :           <CFSET Client.UserName = Form.UserName>
5 :           <DIV ALIGN="center">
6 :           Congratulations! You have successfully signed up as a member of <CFOUTPUT>#Forum.Name#</CFOUTPUT>.<BR><BR><BR>
_______________________________________________________

I tried to enable my scopes globally using my application.cfm and here it is......


<CFAPPLICATION NAME="kforum"
    CLIENTMANAGEMENT="Yes"
    CLIENTSTORAGE="Registry"
     sessionmanagement="yes"
     sessiontimeout="#CreateTimeSpan(0,0,60,0)#"
    SETCLIENTCOOKIES="Yes" >



<CFSET Admin.Username="Administrator">
<CFSET Admin.Password="pass">
<CFSET Forum.Name="Kingdom Forum">
<CFSET Forum.URL="http://www.fgkc.com/KingdomForum/index.cfm">
<CFSET Website.Title="Full Gospel Kingdom Church">
<CFSET Website.URL="index.cfm">
<CFSET Database.DSN="fgkc_com">
<CFSET GuestLoginAllowed="False">
<CFSET Color1="FBBF32">
<CFSET Color2="A43122">
<CFSET BGColor="FF7F00">
<CFPARAM NAME="recordsshown" DEFAULT="25">



<CFPARAM NAME="action" DEFAULT="">
<CFPARAM NAME="Client.UserName" DEFAULT="Guest">
<CFPARAM NAME="Client.LoggedIn" DEFAULT="False">
<CFPARAM NAME="Client.AdminLoggedIn" DEFAULT="False">
<CFPARAM NAME="postid" DEFAULT="0">
<CFPARAM NAME="cookie.username" DEFAULT="">
<CFPARAM NAME="startrow" DEFAULT="1">

_______________________________________________________


Here is the coding for my action.cfm page It almost looks like a creation from Dr. Giggles because I have been trying to fix all the other errors but it continues to say that my scope CLIENT has not been enabled.......

<CFPARAM NAME="Client.UserName" DEFAULT="Guest">
<CFPARAM NAME="Client.LoggedIn" DEFAULT="False">
<CFPARAM NAME="Client.AdminLoggedIn" DEFAULT="False">



<CFSET Forum.Name="Kingdom Forum">

<CFIF action EQ "signup">
     <CFINSERT DATASOURCE="fgkc_com" TABLENAME="tblUsers" FORMFIELDS="FirstName, LastName, Email, Username, Password">
          <CFINCLUDE TEMPLATE="header.cfm">
          <CFSET Client.UserName = Form.UserName>
          <DIV ALIGN="center">
          Congratulations! You have successfully signed up as a member of <CFOUTPUT>#Forum.Name#</CFOUTPUT>.<BR><BR><BR>
          <TABLE WIDTH="400" BGCOLOR="#9999FF"><TR><TD>
          <CFOUTPUT>
               First Name: #Form.FirstName#<BR>
               Last Name: #Form.LastName#<BR>
               E-mail: #Form.Email#<BR>
               Username: #Form.Username#<BR>
               Password: #Form.Password#<BR>
          </CFOUTPUT>
          </TD></TR></TABLE>
          <BR><BR>
          <A HREF="viewposts.cfm">Continue</A>
          </DIV>
<CFELSEIF action EQ "post">

     <CFIF GuestLoginAllowed EQ "False">
          <CFIF Client.LoggedIn EQ "False">
               <DIV ALIGN="center">
                    You are not logged in.
                    <BR><BR>
                    <A HREF="signup.cfm">Non Members: Sign Up</A><BR><BR>
                    <A HREF="login.cfm">Members: Sign In</A>
               </DIV>
               <CFABORT>
          </CFIF>
     </CFIF>

     <CFSET Form.PostAuthor = #ReplaceList(Form.PostAuthor, "<,>", "<,>")#>
     <CFSET Form.PostHeader = #ReplaceList(Form.PostHeader, "<,>", "<,>")#>
     <CFSET Form.PostMessage = #ReplaceList(Form.PostMessage, "<,>", "<,>")#>
     <CFSET Form.PostMessage = #Replace(Form.PostMessage, Chr(13), "<br>", "all")#>
     <CFINSERT DATASOURCE="#Database.DSN#" TABLENAME="tblPosts" FORMFIELDS="PostAuthor, PostHeader, PostMessage, TopPost">
          <CFINCLUDE TEMPLATE="header.cfm">
               <DIV ALIGN="center">
                    Post Successful!
                    <CFIF TopPost EQ 0>
                         <A HREF="viewposts.cfm">Continue</A>
                    <CFELSE>
                         <A HREF="viewposts.cfm?action=viewpost&postid=<CFOUTPUT>#Form.TopPost#</CFOUTPUT>">Continue</A>
                    </CFIF>
               </DIV>
<CFELSEIF action EQ "login">

<CFCOOKIE NAME="username" VALUE="One" EXPIRES="NOW">

     <CFQUERY NAME="qry_Login" DATASOURCE="fgkc_com">
          SELECT Username, Password
          FROM tblUsers
          WHERE Username = '#Form.Username#' AND Password = '#Form.Password#'
     </CFQUERY>

     <CFOUTPUT QUERY="qry_Login">
     
     <CFPARAM NAME="Client.UserName" DEFAULT="Guest">
<CFPARAM NAME="Client.LoggedIn" DEFAULT="False">
     
     
     
     <CFIF qry_Login.Recordcount EQ 1>
     
          <CFIF IsDefined('Form.RememberUsername')>
               <CFCOOKIE NAME="username" VALUE="One">
          <CFELSE>
               <CFCOOKIE NAME="username" VALUE="Two">
          </CFIF>
          
          <CFSET Client.LoggedIn = "True">
          <CFSET Client.UserName = '#Username#'>
          
          <CFLOCATION URL="viewposts.cfm" ADDTOKEN="No">
          
     <CFELSE>
          Invalid Username and/or Password
     </CFIF>
     </CFOUTPUT>

<CFELSEIF action EQ "logout">

     <CFSET Client.LoggedIn = "False">
     <CFSET Client.UserName = "Guest">
     <CFLOCATION URL="#Website.URL#" ADDTOKEN="No">
     
<CFELSEIF action EQ "GuestLogin">

     <CFSET Client.LoggedIn = "False">
     <CFSET Client.UserName = "Guest">
     <CFLOCATION URL="viewposts.cfm" ADDTOKEN="No">

<CFELSE>

     Error. Please press your back button.

</CFIF>

I don't know what the deal is I tested it on the tested here, but when I get it on the host, I get the error.  Could it be their server or my code?


Kindest Regards, CPINK

This message was edited by cpink on 2-29-04 @ 11:12 PM

dk
02-29-2004 @ 11:17 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 48
Joined: Jan 2004

Where is your application.cfm located?
Also, if you are not using Session Variables in your app, get rid of the session management and the session timeout.

cpink
02-29-2004 @ 11:38 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Feb 2004

It is located in http://www.fgkc.com/message/application.cfm

Kindest Regards, CPINK

This message was edited by cpink on 3-1-04 @ 12:06 AM

dk
03-01-2004 @ 12:11 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 48
Joined: Jan 2004

Try changing the location of the clientstorage to something other than the registry. I have a table in my database that I use.
I went to the website, there seem to be some other errors. I noticed a <script> tag that was opened, but never closed with a </script>.
I also noticed a bgcolor being used, I think the # needs to be escaped with a preceding pound.

Dusty

cpink
03-01-2004 @ 12:11 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Feb 2004

I tried it with out the session values, but I still got the the same out come.  Even then my application.cfm should work, because in the root directory I have no other there is only a second one and it is still in another directory.

Kindest Regards, CPINK

cpink
03-01-2004 @ 7:30 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Feb 2004

In my application.cfm file how would I clear a previous session.

Kindest Regards, CPINK

dk
03-01-2004 @ 8:20 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 48
Joined: Jan 2004

With client scoped variables, you do not clear the session. You delete the client variable like so:

DeleteClientVariable("MyVar")

Hope this helps.

cpink
03-01-2004 @ 8:25 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Feb 2004

Where in the application.cfm would that go.

Kindest Regards, CPINK

dk
03-01-2004 @ 8:28 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 48
Joined: Jan 2004

It doesn't, you can put it wherever you want to expire a client variable. If someone closes the application, the session is automatically terminated.

In a database, the variables are automatically purged after 90 days of unuse, I reset mine to 5 days. Just for a short history. This is done thru the Coldfusion Administrator.

cpink
03-01-2004 @ 8:34 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 21
Joined: Feb 2004

So if this doesn't work then it means that it is a server issue, right?  I am with apollohosting and they keep telling me its my code and from this end I can't see why what would I tell them to check for so that they won't give me the run around.

Kindest Regards, CPINK

PAGE: 1 2 3

Website Designed and Developed by Pablo Varando.