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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frames and Logging In

Status
Not open for further replies.

CFTyrant

Programmer
Mar 25, 2002
13
0
0
US
I am in the process of creating a password protected portion of my site that will be using a frameset.

The left frame is the navigation menu, the right (larger) frame is the primary display window.

Here is the frameset code:

<cfinclude template=&quot;header.cfm&quot;>
<frameset rows=&quot;159,160&quot;>
<frame src=&quot;menu.cfm&quot;>
<frame src=&quot;main.cfm&quot;>
</frameset>

<noframes>
<body bgcolor=&quot;#FFFFFF&quot;>No frame support.
</body>
</noframes>
</html>

Header.CFM Code:

<cfif isdefined(&quot;session.loggedin&quot;)>
<cfif session.loggedin eq &quot;no&quot;>
<cflocation url=&quot;login.cfm&quot;>
</cfif>
<cfelse>
<cflocation url=&quot;login.cfm&quot;>
</cfif>


As soon as the login information is confirmed the login.cfm page directs the person to the frameset.

But the actual frameset never gets displayed, if I view the source of the page I see the frameset commands, but they just aren't executing.

Any suggestions?
 
Is there any body tags in the header.cfm? That will prevent the frames from displaying. Post the source of the code that is generated -- that would help.

Tim P.
 
THere are no body tags in the header.cfm or the application.cfm, I did re-create the frameset - here is its code:

index.cfm:

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

<html>
<head>
<title>test</title>
</head>

<body>
<cfinclude template=&quot;header.cfm&quot;>

<frameset cols=&quot;17%,*&quot;>
<frame name=&quot;menu&quot; src=&quot;menu.cfm&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; scrolling=&quot;auto&quot; frameborder=&quot;0&quot;>
<frame name=&quot;main&quot; src=&quot;main.cfm&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; scrolling=&quot;auto&quot; frameborder=&quot;0&quot;>
</frameset>


</body>
</html>



Here is the output as displayed in IE:

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

<html>
<head>
<title>test</title>
</head>

<body>



<frameset cols=&quot;17%,*&quot;>
<frame name=&quot;menu&quot; src=&quot;menu.cfm&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; scrolling=&quot;auto&quot; frameborder=&quot;0&quot;>
<frame name=&quot;main&quot; src=&quot;main.cfm&quot; marginwidth=&quot;10&quot; marginheight=&quot;10&quot; scrolling=&quot;auto&quot; frameborder=&quot;0&quot;>
</frameset>


</body>
</html>


also - here is my login.cfm (I removed all body tags from there as well, no change)

<br><strong>Please enter your Username and password, and click the submit button.</strong>
<form action=&quot;password.cfm&quot; method=&quot;post&quot; name=&quot;login&quot;>
<br><br>
<strong>Username:</strong>
<input type=&quot;text&quot; name=&quot;Oper&quot; size=11>
<br><br>
<strong>Password:</strong>
<input type=&quot;Password&quot; name=&quot;pass&quot; size=11>
<br><br><br><input type=&quot;submit&quot; value=&quot;Submit&quot; name=&quot;B1&quot;><input type=&quot;reset&quot; value=&quot;Reset&quot; name=&quot;B2&quot;>

</font>
</form>


And finally, the password.cfm where the password is confirmed (again all body reference have been removed):

<cfquery name=&quot;password&quot; datasource=&quot;#application.ds#&quot;>
Select *
from htpasswd
Where userid = '#Form.Oper#'
and password = '#Form.Pass#'
</cfquery>

<cfif password.RecordCount eq &quot;0&quot;>
<cfoutput>
LOGIN ERROR!!!!!!!
<br>
Please go back and try again.
<br>
<cfinclude template=&quot;login.cfm&quot;>
</cfoutput>
</cfif>
<cfif password.RecordCount Is not &quot;0&quot;>
<cfset session.Userid = #password.userid#>
<cfset session.group = #password.groupmem#>
<cfset session.loggedin = &quot;yes&quot;>
<cflocation url=&quot;index.cfm&quot;>

</cfif>

If I remove the header.cfm reference from my index.cfm the frameset loads just fine, but of course there's no authentication then.

Your assistance is greatly appreciated!
 
Why don't you put the header.cfm code in application.cfm ?
 
Take out the <body> </body> tags. That prevents the frameset from being displayed. Those should only be in the <noframes> tag inside the <frameset> tag.

Tim P.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top