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

IE works OK but NS crashes. Why? Please help me out! (see code!)

Status
Not open for further replies.

josel

Programmer
Joined
Oct 16, 2001
Messages
716
Location
US
Following is aimed to provide registered users with a page to view their activity history and edit their personal profile ...

Main template uses several <cfinclude>. Each included template has a generic purpose or specific to the main template ...

-----------------------------------------------------------------------------------
myProfile.cfm is the main template which includes several other templates to fill columns and/or tables (here is the code):

<cfif isdefined(&quot;session.UserName&quot;)>
<cfif isdefined(&quot;URL.ID&quot;)>
<cfquery name=&quot;getUser&quot; datasource=&quot;deco&quot; dbtype=&quot;odbc&quot;>
select *
from sysAccounts
where UserID=#session.UserID#
</cfquery>
<cfquery name=&quot;getID&quot; datasource=&quot;deco&quot; dbtype=&quot;odbc&quot;>
select *
from sysUserID
where UserID=#session.UserID#
</cfquery>
</cfif>
</cfif>

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

<cfset session.PageTitle=&quot;Registration Form&quot;>

<html>

<cfinclude template=&quot;_JavScripts.cfm&quot;>

<head>
<title>Shelley Biotechnologies, Inc.</title>

<!--- Load CSS settings --->
<cfinclude template=&quot;_styles.cfm&quot;>

</head>

<BODY bgcolor=&quot;4682B4&quot; topmargin=&quot;6&quot;>

<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;>
<tr bgcolor=&quot;ffdead&quot;>
<td colspan=&quot;2&quot;>
<cfinclude template=&quot;_header.cfm&quot;>
</td>
</tr>
<tr bgcolor=&quot;ffdead&quot;>
<td colspan=&quot;2&quot;>
<cfinclude template=&quot;_toprow.cfm&quot;>
</td>
</tr>
<tr>
<td bgcolor=&quot;ffdead&quot; height=&quot;220&quot; valign=&quot;top&quot; width=&quot;18%&quot;>
<font class=&quot;nav&quot;>
<cfinclude template=&quot;_navBar.cfm&quot;>
</font>
</td>
<td bgcolor=&quot;ffdead&quot; valign=&quot;top&quot; height=&quot;100%&quot; width=&quot;82%&quot;>
<table bgcolor=&quot;white&quot; height=&quot;100%&quot; width=&quot;98%&quot; border=&quot;1&quot; frame=&quot;box&quot; bordercolor=&quot;black&quot;>
<tr>
<td width=&quot;100%&quot; height=&quot;100%&quot;>
<cfform name=&quot;uptProfile&quot; action=&quot;profileManager.cfm?method=Update&quot; method=&quot;post&quot;>
<table border=&quot;0&quot; height=&quot;100%&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;>
<tr>
<td height=&quot;100%&quot; width=&quot;30%&quot; valign=&quot;top&quot; align=&quot;left&quot;>
<cfinclude template=&quot;myProfileCol01.cfm&quot;><br>&nbsp;
</td>
<td height=&quot;100%&quot; width=&quot;30%&quot; align=&quot;right&quot; valign=&quot;top&quot; bgcolor=&quot;lightgrey&quot;>
<cfinclude template=&quot;myProfileCol02.cfm&quot;>
</td>
<td height=&quot;100%&quot; width=&quot;45%&quot; valign=&quot;top&quot; align=&quot;left&quot; bgcolor=&quot;lightgrey&quot;>
<cfinclude template=&quot;myProfileCol03.cfm&quot;>
</td>
</tr>
<tr>
<td>
&nbsp;
</td>
<td valign=&quot;top&quot; bgcolor=&quot;lightgrey&quot;>
&nbsp;&#149;&nbsp;Required Field
</td>
<td align=&quot;right&quot; bgcolor=&quot;lightgrey&quot;>
&nbsp;<input type=&quot;submit&quot; value=&quot; Update &quot;>
</td>
</tr>
</table>
</cfform>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor=&quot;ffdead&quot; height=&quot;120&quot; colspan=&quot;2&quot; align=&quot;center&quot;>
<font class=&quot;nav&quot;>
<cfinclude template=&quot;_hormenu.cfm&quot;>
</font>
<p>&nbsp;
<cfinclude template=&quot;_footer.cfm&quot;>
</td>
</tr>
</table>
<!--- Show phone number @ absolute position --->
<!--- <img class=&quot;flex&quot; src=&quot;images/comphone.jpg&quot;> --->

</body>
</html>

----------------------------------------------------------------------------------------

_vermenu.cfm is the template which shows list of product types with links to their associated CF templates - Here's the code:

<cfquery name=&quot;categories&quot; datasource=&quot;deco&quot;>
select *
from sysProdType
</cfquery>
<img src=&quot;images/sp15.gif&quot; width=&quot;5&quot;>
<li><a href=&quot;index.cfm&quot;>
Home
</a></li>

<cfif &quot;#categories.recordcount#&quot; gt &quot;0&quot;>
<cfoutput query=&quot;categories&quot;>
<img src=&quot;images/sp15.gif&quot; width=&quot;5&quot;>
<li><a href=&quot;searchItem.cfm?itemType=#categories.CategoryID#&quot;>
#categories.CategoryCode#
</a></li>
</cfoutput>
</cfif>

<table width=&quot;96%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>
<td>
&nbsp;
</td>
</tr>

<tr>
<td>
<font size=&quot;2&quot;>
Find it here!
</font>
</td>
</tr>
<tr>
<td>
<form name=&quot;frmJumpMenu&quot;>
<select name=&quot;selJumpMenu&quot; onChange=&quot;JumpMenu('parent',this,0)&quot;>
<option value=&quot;search.cfm?key=Products&quot; selected>Products</option>
<cfoutput query=&quot;categories&quot;>
<option value=&quot;searchItem.cfm?itemType=#categories.CategoryID#&quot;>#categories.CategoryCode#</option>
</cfoutput>
</select>
</form>
</td>
</tr>

</table>

----------------------------------------------------------------------------------

myProfileCol01.cfm is the template responsible for loading and showing applicable options to user - Here's the code:

<cfif (&quot;getUser.recordcount&quot; IS NOT &quot;0&quot;) AND (&quot;getID.recordcount&quot; IS NOT &quot;0&quot;)>
<cfoutput>

<table width=&quot;100%&quot; border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>
<td valign=&quot;top&quot; align=&quot;left&quot; bgcolor=&quot;lightblue&quot;>
<center><b>Last Updated</b></center><br>
<cfif &quot;getUser.LastUpdated&quot; IS NOT &quot;&quot;>
#getUser.LastUpdated#
<cfelse>
Never!
</cfif>
</td>
</tr>
<tr>
<td valign=&quot;top&quot; align=&quot;left&quot;>
<p>&nbsp;
<center><b>History Tracker</b></center>
<font class=&quot;nav&quot;>
<li><a href=&quot;&quot;>Track an Order</a></li>
<li><a href=&quot;&quot;>Things you purchased</a></li>
</font>
</td>
</tr>
</table>

</cfoutput>
</cfif>


*** <END-OF-CODE> ***

I am getting error on line 9 of myProfileCol01.cfm when attempting to show #getUser.LastUpdated#. I have checked table's field name and it is a perfect match (I even dragged it in).

I am using MS Access. The field is blank, so I can't even understand why is condition true if I am checking if as not blank (<cfif &quot;#getUser.LastUpdated#&quot; IS NOT &quot;&quot;>). The field is TEXT type.

Sorry for the long post, but I figure that if you see the code, you stand a better chance to find the actual problem and I getting an answer :o)

Thank you all in advance;


josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
You have got quotes around the getUser.LastUpdated (myprofile01.cfm) so it is treating this as a string. remove the quotes so that the line looks like this

<cfif getUser.LastUpdated IS NOT &quot;&quot;>

and do the same for all of the other if statements on the page, for instance the getUser.RecordCount at the top of the myprofile01.cfm.

Try that !
 
Well, IE continues to work without quotes but NS does not :(

I removed my quotes from <cfif getUser.recordcount ...> and it fails. I'm told I do not need quotes here but yet, the browsers think otherwise.

I am inclined to merging all included templates into one and try it that way ... but if I understand the way it works, code is not interpreted by server until ALL templates are fully loaded thus a single, combined, template is resolved, this really should not make a diffence.

Regards;

josel
If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Josel,

Try the following:

<cfif getUser.LastUpdated IS NOT &quot;&quot; or getUser.LastUpdated IS NOT &quot; &quot;>

Sometimes, I've found out, CF will recognize a blank as a null.

Hope it helps.

Change Your Thinking, Change Your Life.
 
You didn't say what version of Netscape is crashing. What follows assumes it's Netscape 4.

Netscape 4 tends to crash if it sees HTML or CSS it thinks is incorrect. Reading all your generated HTML would be hard work, so let me suggest an easier way. Copy the generated HTML from an IE window (View Source outputs the code to Notepad, and it's easy to copy from there), then paste the generated HTML into an HTML validator - you could use the WDG's ( if you want every minor deviation flagged, or paste into a new window in the CF Studio and use Tools Validate (but CF's validator is not 100% accurate).

This approach has a couple of limitations:
* if you generate browser-specific HTML (e.g. LAYERs for Netscape 4 and DIVs for IE), you can't get IE to show you the Netscape-specific HTML and you have to check this the hard way.
* IE does not display HTML created by Javascript's document.write, so you can't use use this approach to check HTML generated by Javascript.

You should also check out any CSS you use, e.g with WGD's CSS validator ( - I've known Netscape 4 to crash becasue of CSS problems.

If none of this works, try validating the previous 2 pages - Netscape sometimes appears to survive a page with HTML or CSS errors and then crash on the next one.
 
You didn't say what version of Netscape is crashing. What follows assumes it's Netscape 4.

Netscape 4 tends to crash if it sees HTML or CSS it thinks is incorrect. Reading all your generated HTML would be hard work, so let me suggest an easier way. Copy the generated HTML from an IE window (View Source outputs the code to Notepad, and it's easy to copy from there), then paste the generated HTML into an HTML validator - you could use the WDG's ( if you want every minor deviation flagged, or paste into a new window in the CF Studio and use Tools Validate (but CF's validator is not 100% accurate).

This approach has a couple of limitations:
* if you generate browser-specific HTML (e.g. LAYERs for Netscape 4 and DIVs for IE), you can't get IE to show you the Netscape-specific HTML and you have to check this the hard way.
* IE does not display HTML created by Javascript's document.write, so you can't use use this approach to check HTML generated by Javascript.

You should also check out any CSS you use, e.g with WGD's CSS validator ( - I've known Netscape 4 to crash becasue of CSS problems.

If none of this works, try validating the previous 2 pages - Netscape 4 sometimes appears to survive a page with HTML or CSS errors and then crash on the next one.
 
This NS browser is really putting my debugging skills to the test.

I have looked at every line of code and changed every line to what you guys suggest and I am still having problems. I do not get the HTML page as the error is:

An error occurred while evaluating the expression:

&quot;#application.root##application.profile#myProfileManager.cfm?Method=Update&ID=#session.userID#&quot;

Error near line 56, column 39.

Error resolving parameter SESSION.USERID


Within my login page I have a group of session variables been initiated, session.userID is one of them. A I jump around, templates show information which ONLY show if session variable is set but, when I click on one of the links (to view my profile as an user/visitor), I get the above error. If I try this using IE, it works find. The variables are fine.

I am using NS 4.75 ... Should I upgrade? Is NS known for having problems when employing session variables. I am intending to use these babies all day long, as well as, application variables.

If any one out there has have an idea as to what's bugging me, please help!

Thank you all for you suggestions!!!

Regards;

Jose Lerebours If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Well, that helps. It has something to do with the session variable not being defined. Do you have cookies turned on in Netscape?
 
Hello a440guy!

Well, I use the same browser to access this forum and it works ... I guess that my browser is then cookie enabled. I looked around and was not able to find any where where this is set ON/OFF.

Yes, the session.userID variable is defined. In fact, the link I use to access the profile page, which causes above error, is shown as other session variables are checked and they are also set at the same time within the same page (login page).

Following is the snip of code where variables are set:

<cfif isdefined(&quot;url.login&quot;)>
<cfquery name=&quot;getUser&quot; datasource=&quot;deco&quot;>
select *
from sysUserID
where UserCode='#form.userName#' and UserPswd='#form.password#'
</cfquery>
<cfif getuser.recordcount gt &quot;0&quot;>
<cfset session.loggedIn=&quot;yes&quot;>
<cfset session.userID=&quot;#getUser.UserID#&quot;>
<cfset session.userName=&quot;#getUser.UserName#&quot;>
<cfset session.userLevel=&quot;#getuser.UserLevel#&quot;>
<cflocation url=&quot;index.cfm&quot;>
<cfelse>
<cflocation url=&quot;login.cfm?failed=yes&quot;>
</cfif>
</cfif>

--------------------------------------------------------------------------------------
And this is my application template:

<CFAPPLICATION NAME=&quot;DecoDemo&quot; CLIENTMANAGEMENT=&quot;Yes&quot;
SESSIONMANAGEMENT=&quot;Yes&quot; SETCLIENTCOOKIES=&quot;No&quot;
SESSIONTIMEOUT=&quot;#CREATETIMESPAN(0,1,0,0)#&quot;
APPLICATIONTIMEOUT=&quot;#CREATETIMESPAN(2,0,0,0)#&quot;>

<cfset application.dsn=&quot;deco&quot;>
<cfset applicaiton.username=&quot;josel&quot;>
<cfset applicaiton.password=&quot;mypassword&quot;>
<cfset application.title=&quot;Deco Demo, Inc.&quot;>
<cfset application.company=&quot;Jose D. Lerebours 2001-2002&quot;>


<!--- Set directories used within CFML templates --->
<cfset application.root=&quot;/wallpaper/&quot;> <!--- Root Directory --->
<cfset application.images=&quot;images/&quot;> <!--- Image Depository --->
<cfset application.admin=&quot;sysAdmin/&quot;> <!--- System Administration Pages --->
<cfset application.temp=&quot;temp/&quot;> <!--- Tempory Holding Directory --->
<cfset application.includes=&quot;includes/&quot;> <!--- Directory wehere included templates are kept --->
<cfset application.monthly=&quot;mthEvent/&quot;> <!--- Here we keep all pages associated to monthly events --->
<cfset application.products=&quot;products/&quot;> <!--- Product related searches and inquiries --->
<cfset application.profile=&quot;profile/&quot;> <!--- Visitors profile processing --->

--------------------------------------------------------------------------------------

Thanks for you help;


Jose Lerebours If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
I'm sorry, your error message, &quot;Error resolving parameter SESSION.USERID&quot; indicates to me that the variable SESSION.USERID is not defined in the context that it is used.
 
I agree. The error does point to that. If variable was not defined, there should be no reason for the same process to work in IE ... Agree?

These are the steps I am taking to give you an idea:

A) Accesss index.cfm which hides some options only available to logged-in users
B) Sign-In using login.cfm
B1) login.cfm sets session variables and returns control to index.cfm
C) index.cfn now shows options for logged-in users
C1) Options check if session.UserName is defined and shows user name as link to access user's preference/profile information (myProfile.cfm)
D) myProfile.cfm works OK under IE but fails with above error with NS

I tried other session variables in lieu of session.userID and they all fail at the same way. I wonder then, what can clear or reset session variables?

Can my applicaiton.cfm do this as the sessiontimeout is executed unconditionally? I have looked all over and found nothing warning of any known issues between session variables and netscape ...

Thank you once again!

Jose Lerebours If you have the knowledge, consult and educate those who need it! - Jose Lerebours
 
Do you pop open a new window at the time that Netscape fails? Maybe it's not passing session.userid for some reason.

You might try inserting some debugging writes along the path from page to page that session.userid is supposed to take. This might already be obvious to you, but test it anyway. At least it will point out where to focus your investigation.

I also suggest that you upgrade Netscape to 4.79 just in case. Go to and click on &quot;Netscape Communicator&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top