Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Database Connection Issues
 CJWSoft Support Info : Database Connection Issues
Subject Info: How to code before user logs in A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
Guests
Guest Group
Guest Group


Joined: April/06/2004
Online Status: Online
Info: -35
Added: July/06/2006 at 6:37am | IP Logged Quote Guests

I have FP2003 with common borders enabled. The top border has a table 3 rows by 2 columns. Column 1 is merged, and a graphic goes in that cell. Column 2 is supposed to have variable information based on whether or not the user has logged in. My idea is to test for login (somehow) and use a simple IF-THEN structure to display one of two messages. My home page has the common border.

When I first hit the site (before logging in) the VB code displays in the border. As soon as I log in, however, the VB code goes away and the variable info displays as I expect.

I'm pretty sure the problem is a newbie error, but after a couple of hours struggling with it, I'm ready to ask for a hint.

I've tried various combinations of the logic using IsNull, IsEmpty, etc. without success.

One version of the code:

------------------------------------------------------------ -----
<%@ LANGUAGE="VBSCRIPT" %>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Shared Top Border</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="none">
<meta name="Microsoft Border" content="none">
</head>

<body>

<table border="0" width="100%" id="table2">
    <td><i><font face="Times New Roman">
        <tr>
            <td width="142" rowspan="3">
            <img border="0" src="../images/navigate/AWClogo_blue_xp.gif" width="130" height="73"></td>
           
            <% If Session("First_Name") <> "" Then %>
                Welcome, <% Response.Write(Session("FIRST_NAME")) %>
            <% End if %>
        </tr>
        <tr>
            <% If Session("First_Name") <> "" Then %>
                You are logged in to the website of
            <% End if %>       
        </tr>
    </font></i></td>
    <tr>
        <td><i><b><font face="Times New Roman" size="5" color="#0000FF">The
        American Women's Club of Korea</font></b></i></td>
    </tr>
</table>
<p align="left"><br>
<!--webbot bot="Navigation" s-type="global" s-orientation="horizontal" s-rendering="graphics" b-include-home="TRUE" b-include-up="TRUE" -->
</p></body></html>

Back to Top View Guests's Profile Search for other info by Guests
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1729
Added: July/06/2006 at 11:16am | IP Logged Quote cwilliams

All I can say about shared/common borders are they are one of those newbie features of Frontpage that nobody who is into Server Side code like ASP should be using. I have read a ton of articles where shared borders and other frontpage only features cause big problems when using other server side code.

I use frontpage myself to manage and edit my sites, but there are about a zillion crappy/gay features in it I stay away from too.

If your into using Server Side code you really want to do various things by hand. Such as making your own css files and using server side includes instead of frontpage extension stuff. (Themes beingh another evil frontpage feature) Most importantly understanding html tags enough to easily edit any page in text mode when necessary.

http://www.d2stuff.com/frontpage/weenie_features.htm
http://www.interlacken.com/winnt/tips/tipshow.aspx?tip=29

Aside from all that..

Personally I would test your code out on some simple ".asp" pages before you go trying to figure out why it does not work in a page using the shared borders stuff.

Make a simple example page to log into.
Make a simple example page to test for the login.

I would also test for this..

If Session("PasswordAccess") = "Yes" Then
' show whatever
End If

Then if that does not work we'll continue this thread..



__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1729
Added: July/06/2006 at 11:32am | IP Logged Quote cwilliams

Now that I think about it that shared border thing is probably definetely the issue.

Server side code in it isn't going to work like you want it to because of the way Frontpage deals with the shared border page and inserts it into the other pages...

Start using server side includes to surround your code with header and footer stuff and stop using shared borders is my suggestion..

__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
Guests
Guest Group
Guest Group


Joined: April/06/2004
Online Status: Online
Info: -35
Added: July/06/2006 at 11:43pm | IP Logged Quote Guests

Thanks for the followup message... I appreciate it.

I created simple pages without borders, as you suggested, but the problem did not go away.

The problem actually seems to be that I'm doing all this on the home page, index.htm, and the server is not processing the scripting code. When I change the page name to index.asp, the code works as I expect, but then of course I get a "page not found" error when first accessing the site.

I'm going to experiment with ways to force evaluation of the script in index.htm and/or do a redirect from index.htm to index.asp. Any suggestions on which would be more expedient? Or is there a better way?
Back to Top View Guests's Profile Search for other info by Guests
 
cwilliams
Admin Group
Admin Group
Avatar
CJWSoft Web Software Developer

Joined: April/06/2004
Online Status: Offline
Info: 1729
Added: July/06/2006 at 11:49pm | IP Logged Quote cwilliams

oh man... wish I knew that before I wrote all that

of course it isn't going to work with a .htm page.. I just figured you knew that

.htm is not ASP

.asp is ASP

my suggestion is rename the main page to default.asp

dont use index.htm...or aything .htm cause ya the ASP ain't gonna execute 

besides on microsoft servers index.htm takes a back seat to default.htm and default.asp

"index" came from the unix world of webservers



__________________

Best Regards, Christopher Williams www.CJWSoft.com
Back to Top View cwilliams's Profile Search for other info by cwilliams Visit cwilliams's Homepage
 
Guests
Guest Group
Guest Group


Joined: April/06/2004
Online Status: Online
Info: -35
Added: July/06/2006 at 11:57pm | IP Logged Quote Guests

Sorry... I did know that...  I'm rusty as a programmer. Didn't realize just how rusty.

Thanks for the tip on using default.asp

Back to Top View Guests's Profile Search for other info by Guests
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area


vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.powerasp.com,www.aspclassifieds.com,www.aspphotogallery.com,www.codewanker.com