Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 I have a Great idea!
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 5

gor
Retired Admin

Netherlands
5511 Posts

Posted - 11 March 2001 :  18:14:09  Show Profile  Visit gor's Homepage
Pic1 can be found in topic.asp
Note: You need to add the code to do this at two places: once in the sub GetFirst() starting at around line 445 which displays the initial topic and once around line 319 where you find the code for all the replies.
Just to help you find it, this is the code that display the Membername, title and the stars:

<% if strUseExtendedProfile then %>
<a href="pop_profile.asp?mode=display&id=<% =rs("R_AUTHOR") %>">
<% else %>
<a href="JavaScript:openWindow3('pop_profile.asp?mode=display&id=<% =rs("R_AUTHOR") %>')">
<% end if %>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b><% =ChkString(rs("M_NAME"),"display") %></a>
</b></font>
<% if strShowRank = 1 or strShowRank = 3 then %>
<br><font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><small><% = ChkString(getMember_Level(rs("M_TITLE"), rs("M_LEVEL"), rs("M_POSTS")),"display") %></small></font>
<% end if %>
<% if strShowRank = 2 or strShowRank = 3 then %>
<br><% = getStar_Level(rs("M_LEVEL"), rs("M_POSTS")) %>
<% end if %>


As far as checking to see if a member is logged on goes:
In Inc_top.asp you'll find this call for ChkUser2

mLev = cint(ChkUser2(strDBNTUserName, Request.Cookies(strUniqueID & "User")("Pword")))

mLev = 0 means that the user is not logged on
mLev = 1 means that the user is the author of the topic/reply (n/a in your case)
mLev = 2 means the user is logged on / normal user
mLev = 3 means that the user is a moderator of a forum
mLev = 4 means that the user is a Administrator

If you only want to allow Administrators to a page you might want to check out the start of all the Admin_xxxx.asp pages. They use this:

<!--#INCLUDE FILE="config.asp" -->
<% If Session(strCookieURL & "Approval") = "15916941253" Then %>
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE file="inc_top.asp" -->

and at the end:

<!--#INCLUDE file="inc_footer.asp" -->
<% else %>
<% Response.Redirect "admin_login.asp" %>
<% end if %>

to make sure you have logged on using the extra logon screen at admin_logon.asp

Other security considerations: use ChkString() for everything you store in the database, so ' won't break the sql-statement
Also use ChkString() for every field that can be set by a user, i.e. the member-name. See the examples in the code. This prevents that the user could enter live HTML or Script code in those fields.




Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 11 March 2001 :  22:40:48  Show Profile
gor thanks for the help.
This seems too complicated for me, but it's really a good practice for a newbie asp programmer like me. anywayz if anyone is interested working on this COOL project with me please let me know, that will be very helpful.

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 14 March 2001 :  20:34:03  Show Profile
OK this is what i got so far. (games_main.asp)http://www.angelfire.com/ab5/scfff2/games_main.asp

i need to know how i can make the text, text color, cellbackgroud...same as the other pages.. what are the variables

one more question, this page is not suppose to be visible to guests, what is the code that i should include to request the guest to input their username and pass, or to register.

Thanks



Edited by - Freeman II on 14 March 2001 20:35:47
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 15 March 2001 :  00:00:47  Show Profile  Visit gor's Homepage
For the colors you can use these variables:

strDefaultFontFace
strDefaultFontSize
strHeaderFontSize
strFooterFontSize
strPageBGColor
strDefaultFontColor
strLinkColor
strLinkTextDecoration
strVisitedLinkColor
strVisitedTextDecoration
strActiveLinkColor
strHoverFontColor
strHoverTextDecoration
strHeadCellColor
strHeadFontColor
strCategoryCellColor
strCategoryFontColor
strForumFirstCellColor
strForumCellColor
strAltForumCellColor
strForumFontColor
strForumLinkColor
strTableBorderColor
strPopUpTableColor
strPopUpBorderColor
strNewFontColor


You just add them into the code like this:

<font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">

or

<style type=text/css>
<!--
a:link {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
input.radio {background: <% = strPopUpTableColor %>; color:#000000}
-->
</style>

for the links.
You can take a look in the code for things like tablecell background colours, popupcell design, fonts used there etc.
It would probably be a good idea to use

<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

so all the variables get loaded by config.asp / you can use the functions you need to check if the user is logged on / and the default-header of the page is written, including the logon part.

You can something like this after the include of inc_top.asp to only allow logged on users access to the page:

if strDBNTUserName = "" then
doNotLoggedInForm
else
....rest of page code....
end if '## don't forget this at the end !

The sub doNotLoggedInForm in inc_functions.asp has this code:

sub doNotLoggedInForm()
%>
<p align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">There Was A Problem</font></p>

<P align=center><font face="<% =strDefaultFontFace %>" size="<% =strHeaderFontSize %>">
You are not logged in.
</font></p>

<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="JavaScript:history.go(-1)">Go Back To Enter Data</a></font></p>
<p align=center><font face="<% =strDefaultFontFace %>" size=<% =strDefaultFontSize %>><a href="default.asp">Return to the forum</a></font></p>
<!--#INCLUDE FILE="inc_footer.asp"-->
<%
Response.End
end sub



Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  01:06:04  Show Profile
COol it worked! thanks gor
hmm..now im starting to make the first game. ok i created 4 new columes (M_GOLD, M_REP, M_WINS, M_LOSSES) in the FORUM_MEMBERS table (in database). what code should i use to update my database?

something like this?
set users=server.createobject("adodb.recordset")
users.open "Select * From users Where name='"&Session.Contents("UserName")&"'",userconn,0,1


Thanks again for helping me =)

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  06:20:35  Show Profile  Visit gor's Homepage
quote:

COol it worked! thanks gor
hmm..now im starting to make the first game. ok i created 4 new columes (M_GOLD, M_REP, M_WINS, M_LOSSES) in the FORUM_MEMBERS table (in database). what code should i use to update my database?

something like this?
set users=server.createobject("adodb.recordset")
users.open "Select * From users Where name='"&Session.Contents("UserName")&"'",userconn,0,1



If you want to connect to the database when building a MOD, never open an extra Connection to that database. There always is an open connection if you include inc_top.asp (like I suggested in the previous reply).
That connection is called my_Conn

There are many examples in the code where records get added to the code, but most are a bit hard to find.

First an example you can find in register.asp inserting a new user record:

'## Forum_SQL
strSql = "INSERT INTO " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & "(M_NAME"
if strAuthType = "nt" then
strSql = strSql & ", M_USERNAME"
end if
strSql = strSql & ", M_PASSWORD"
strSql = strSql & ", M_EMAIL"
strSql = strSql & ", M_DATE"
strSql = strSql & ", M_COUNTRY"
strSql = strSql & ", M_SIG"
strSql = strSql & ", M_YAHOO"
strSql = strSql & ", M_ICQ"
strSql = strSql & ", M_AIM"
strSql = strSql & ", M_POSTS"
strSql = strSql & ", M_HOMEPAGE"
strSql = strSql & ", M_LASTHEREDATE"
strSql = strSql & ", M_STATUS"
strSql = strSql & ", M_FIRSTNAME"
strSql = strSql & ", M_LASTNAME"
strsql = strsql & ", M_CITY"
strsql = strsql & ", M_STATE"
strsql = strsql & ", M_PHOTO_URL"
strsql = strsql & ", M_LINK1"
strSql = strSql & ", M_LINK2"
strSql = strsql & ", M_AGE"
strSql = strSql & ", M_MARSTATUS"
strSql = strsql & ", M_SEX"
strSql = strSql & ", M_OCCUPATION"
strSql = strSql & ", M_BIO"
strSql = strSql & ", M_HOBBIES"
strsql = strsql & ", M_LNEWS"
strSql = strSql & ", M_QUOTE"
strSql = strSql & ") "
strSql = strSql & " VALUES ("
If strAutoLogon = "1" then
strSql = strSql & "'" & Session(strCookieURL & "strNTUserFullName") & "'"
Else
strSql = strSql & "'" & ChkString(Request.Form("Name"),"name") & "'"
end if
if strAuthType = "nt" then
strSql = strSql & ", " & "'" & strDBNTUserName & "'"
end if
strSql = strSql & ", " & "'" & ChkString(Request.Form("Password"),"password") & "'"
strSql = strSql & ", " & "'" & ChkString(Request.Form("Email"),"email") & "'"
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", " & "'" & ChkString(Request.Form("Country"),"name") & "'"
strSql = strSql & ", " & "'" & ChkString(Request.Form("Sig"),"message") & "'"
strSql = strSql & ", " & "'" & ChkString(Request.Form("YAHOO"),"name") & "'"
strSql = strSql & ", " & "'" & ChkString(Request.Form("ICQ"),"number") & "'"
strSql = strSql & ", " & "'" & ChkString(Request.Form("AIM"),"name") & "'"
strSql = strSql & ", " & "0"
strSql = strSql & ", " & "'" & ChkString(regHomepage,"url") & "'"
strSql = strSql & ", " & "'" & DateToStr(strForumTimeAdjust) & "'"
strSql = strSql & ", " & "1"
if strfullName = "1" then
strSql = strSql & ", '" & ChkString(Request.Form("FirstName"),"") & "'"
strSql = strSql & ", '" & ChkString(Request.Form("LastName"),"") & "'"
else
strSql = strSql & ", ''"
strSql = strSql & ", ''"
end if
if strCity = "1" then
strsql = strsql & ", '" & ChkString(Request.Form("City"),"") & "'"
else
strsql = strsql & ", ''"
end if
if strState = "1" then
strsql = strsql & ", '" & ChkString(Request.Form("State"),"") & "'"
else
strsql = strsql & ", ''"
end if
if strPicture = "1" then
strsql = strsql & ", '" & ChkString(Request.Form("Photo_URL"),"") & "'"
else
strsql = strsql & ", ''"
end if
if strFavLinks = "1" then
strsql = strsql & ", '" & ChkString(Request.Form("LINK1"),"") & "'"
strSql = strSql & ", '" & ChkString(Request.Form("LINK2"),"") & "'"
else
strsql = strsql & ", ''"
strSql = strSql & ", ''"
end if
if strAge = "1" then
strSql = strsql & ", '" & ChkString(Request.Form("Age"),"") & "'"
else
strSql = strsql & ", ''"
end if
if strMarStatus = "1" then
strSql = strSql & ", '" & ChkString(Request.Form("MarStatus"),"") & "'"
else
strSql = strSql & ", ''"
end if
if strSex = "1" then
strSql = strsql & ", '" & ChkString(Request.Form("Sex"),"") & "'"
else
strSql = strSql & ", ''"
end if
if strOccupation = "1" then
strSql = strSql & ", '" & ChkString(Request.Form("Occupation"),"") & "'"
else
strSql = strSql & ", ''"
end if
if strBio = "1" then
strSql = strSql & ", '" & ChkString(Request.Form("Bio"),"message") & "'"
else
strSql = strSql & ", ''"
end if
if strHobbies = "1" then
strSql = strSql & ", '" & ChkString(Request.Form("Hobbies"),"message") & "'"
else
strSql = strSql & ", ''"
end if
if strLNews = "1" then
strsql = strsql & ", '" & ChkString(Request.Form("LNews"),"message") & "'"
else
strSql = strSql & ", ''"
end if
if strQuote = "1" then
strSql = strSql & ", '" & ChkString(Request.Form("Quote"),"message") & "'"
else
strSql = strSql & ", ''"
end if

strSql = strSql & ")"

my_Conn.Execute (strSql)

You can see that this is rather a complex and long statement, but that is because it takes into acount a lot of things, like different setting for the userprofile, if DB authentication is used or NT etc.
But I hope you get the idea.

In the admin pages you find a lot of examples of updating existing records, like this in admin_config_datetime.asp

'## Forum_SQL
strSql = "UPDATE " & strTablePrefix & "CONFIG "
strSql = strSql & " SET C_STRDATETYPE = '" & Request.Form("strDateType") & "', "
strSql = strSql & " C_STRTIMETYPE = '" & Request.Form("strTimeType") & "', "
strSql = strSql & " C_STRTIMEADJUST = " & Request.Form("strTimeAdjust") & " "
strSql = strSql & " WHERE CONFIG_ID = " & 1

my_Conn.Execute (strSql)




Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  14:16:43  Show Profile
i keep getting this error msg whenever i try to read something from the database.

heres the error msg:

Error Type:
Microsoft JET Database Engine (0x80004005)
Could not find file 'C:\WINNT\system32\FORUM_MEMBERS.mdb'.

and heres my code, i copied from pop_profile.asp


<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<%

if strDBNTUserName = "" then
doNotLoggedInGame
else

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PASSWORD"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_GOLD"

set rs = my_Conn.Execute (strSql)
strMyHobbies = rs("M_HOBBIES")
strMyLNews = rs("M_LNEWS")
strMyQuote = rs("M_QUOTE")
strMyBio = rs("M_BIO")


mLev = cint(ChkUser2(Request.Cookies(strUniqueID & "User")("Name"), Request.Cookies(strUniqueID & "User")("Pword")))
%>



i used this to read from db


<% =ChkString(rs("M_GOLD"),"display") %>

at the end of the page i have:

rs.close
set rs = nothing

%><!--#INCLUDE FILE="inc_footer.asp" --><% end if %>

do you know what the problem is?

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  14:31:00  Show Profile  Visit gor's Homepage
Could you post the strConnString= line that is in config.asp ?
It says it can't find your database, doesn't automatically mean anything is wrong with the rest of your code, might just be an error in the string pointing to the database (which is the strConnString)

Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  14:42:50  Show Profile
strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../cgi-bin/forum/snitz_forums_2000.mdb") '## MS Access 2000 using virtual path

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  14:47:29  Show Profile
I tried using this:

<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<%

if strDBNTUserName = "" then
doNotLoggedInGame
else

select case Request.QueryString("mode")

case "display" '## Display Profile


'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PASSWORD"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_GOLD"


set rs = my_Conn.Execute (strSql)

strMyHobbies = rs("M_HOBBIES")
strMyLNews = rs("M_LNEWS")
strMyQuote = rs("M_QUOTE")
strMyBio = rs("M_BIO")


mLev = cint(ChkUser2(Request.Cookies(strUniqueID & "User")("Name"), Request.Cookies(strUniqueID & "User")("Pword")))
%>



and this at the end

<%
end select
rs.close
set rs = nothing

%><!--#INCLUDE FILE="inc_footer.asp" --><% end if %>



and it gives me this error msg

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'rs'

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  14:53:19  Show Profile  Visit gor's Homepage
The reordset (stored in rs) is only opened if Request.QueryString("mode") = "display". (inside the case statement).
But you close it outside the case statement, so when Request.QueryString("mode") <> "display" it doesn't get created, but you still try to close it. That is what the error says (object required, you need to have an object to be able to close it.
To fix it, change:

end select
rs.close
set rs = nothing

to:

rs.close
set rs = nothing
end select



Pierre
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  14:57:41  Show Profile  Visit gor's Homepage
quote:

strConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../cgi-bin/forum/snitz_forums_2000.mdb") '## MS Access 2000 using virtual path



Hmm, strange, are you sure you're not opening another connection ?
This strConnString points to a database called snitz_forums_2000.mbd but the error says it was looking for a database called [b]FORUM_MEMBERS.mdb/b]
Can you see if that is somewere in the code ?

Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  15:24:01  Show Profile
after i changed end select like what you told me, i got this error msg.

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/forum2/game1_main.asp, line 106
end select


heres the codes of my page, save it as game1_main.asp, and copy it to the forum folder. you will see what i mean.


<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<%

if strDBNTUserName = "" then
doNotLoggedInGame
else

select case RRequest.QueryString("mode") = "display"

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PASSWORD"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_GOLD "


set rs = my_Conn.Execute (strSql)

strMyHobbies = rs("M_HOBBIES")
strMyLNews = rs("M_LNEWS")
strMyQuote = rs("M_QUOTE")
strMyBio = rs("M_BIO")


mLev = cint(ChkUser2(Request.Cookies(strUniqueID & "User")("Name"), Request.Cookies(strUniqueID & "User")("Pword")))
%>


<style type=text/css>
<!--a:link {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
input.radio {background: <% = strPopUpTableColor %>; color:#000000}
-->
</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
</table>
<div align="left"></div>

<p> <br>
</p>
<div align=center>
<p><b>Game 1</b><font size="2" class=c><font size="3"><b><br>
<br>
</b></font></font></p>
<p>- Comment1-</p>
<form method="POST" action="game1_post.asp">
<table border=1 cellspacing=0 cellpadding=3 align="center" width="400" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#F2D9B3" width="320"><font size="2" class=c><b></b></font><font size="2"><b>comment
2</b></font></td>
</tr>
<tr bgcolor=#FAF0E2>
<td align=center>You have <b><font color="#CC0000"><% =ChkString(rs("M_GOLD"),"display") %></font>
gold</b></td>
</tr>
<tr>
<td align=center>Place your bet here;
<input type="text" name="splosh" size="10" value="0">
<b>gold</b></td>
</tr>
<tr>
<td align=center bgcolor=#F2D9B3>
<input type="submit" value="GO" name="B1" style="font-size: 12px"><input type="reset" value="Reset" name="B2" style="font-size: 12px"></td>
</tr>
</table>
</form>

<p align="center"> </p>
<p align="center">Caution: you will lose 1 reputation point each time you
gamble.</p>
</div>

</BODY>
</HTML>
<%

rs.close
set rs = nothing
end select
%><!--#INCLUDE FILE="inc_footer.asp" --><% end if %>


Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 16 March 2001 :  15:44:04  Show Profile  Visit gor's Homepage
Why did you change the start of the select / case statement ?
It was:

select case Request.QueryString("mode")

case "display" '## Display Profile

now you changed it to:

select case RRequest.QueryString("mode") = "display"


This part of the code was correct the first time, so try changing it back.




Pierre
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 16 March 2001 :  15:54:01  Show Profile
oh ok
now it shows no error but nothing is displayed except the header and footer.


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

<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->

<%

if strDBNTUserName = "" then
doNotLoggedInGame
else

select case Request.QueryString("mode")
case "display" '## Display Profile

'## Forum_SQL
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_USERNAME, " & strMemberTablePrefix & "MEMBERS.M_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_FIRSTNAME, " & strMemberTablePrefix & "MEMBERS.M_LASTNAME "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_TITLE"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_PASSWORD"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_ICQ"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_YAHOO"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_AIM"
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_CITY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_STATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_COUNTRY "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_POSTS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HIDE_EMAIL "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_DATE "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_PHOTO_URL "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_LINK1, " & strMemberTablePrefix & "MEMBERS.M_LINK2 "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_AGE, " & strMemberTablePrefix & "MEMBERS.M_MARSTATUS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_SEX, " & strMemberTablePrefix & "MEMBERS.M_OCCUPATION "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_SIG"
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_HOBBIES, " & strMemberTablePrefix & "MEMBERS.M_LNEWS "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_QUOTE, " & strMemberTablePrefix & "MEMBERS.M_BIO "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & ", " & strMemberTablePrefix & "MEMBERS.M_GOLD "


set rs = my_Conn.Execute (strSql)

strMyHobbies = rs("M_HOBBIES")
strMyLNews = rs("M_LNEWS")
strMyQuote = rs("M_QUOTE")
strMyBio = rs("M_BIO")


mLev = cint(ChkUser2(Request.Cookies(strUniqueID & "User")("Name"), Request.Cookies(strUniqueID & "User")("Pword")))
%>


<style type=text/css>
<!--a:link {color:<% =strLinkColor %>;text-decoration:<% =strLinkTextDecoration %>}
a:visited {color:<% =strVisitedLinkColor %>;text-decoration:<% =strVisitedTextDecoration %>}
a:hover {color:<% =strHoverFontColor %>;text-decoration:<% =strHoverTextDecoration %>}
input.radio {background: <% = strPopUpTableColor %>; color:#000000}
-->
</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
</table>
<div align="left"></div>

<p> <br>
</p>
<div align=center>
<p><b>Game 1</b><font size="2" class=c><font size="3"><b><br>
<br>
</b></font></font></p>
<p>- Comment1-</p>
<form method="POST" action="game1_post.asp">
<table border=1 cellspacing=0 cellpadding=3 align="center" width="400" bordercolordark="#FFFFFF">
<tr>
<td bgcolor="#F2D9B3" width="320"><font size="2" class=c><b></b></font><font size="2"><b>comment
2</b></font></td>
</tr>
<tr bgcolor=#FAF0E2>
<td align=center>You have <b><font color="#CC0000"><% =ChkString(rs("M_GOLD"),"display") %></font>
gold</b></td>
</tr>
<tr>
<td align=center>Place your bet here;
<input type="text" name="splosh" size="10" value="0">
<b>gold</b></td>
</tr>
<tr>
<td align=center bgcolor=#F2D9B3>
<input type="submit" value="GO" name="B1" style="font-size: 12px"><input type="reset" value="Reset" name="B2" style="font-size: 12px"></td>
</tr>
</table>
</form>

<p align="center"> </p>
<p align="center">Caution: you will lose 1 reputation point each time you
gamble.</p>
</div>

</BODY>
</HTML>
<%

rs.close
set rs = nothing
end select
%><!--#INCLUDE FILE="inc_footer.asp" --><% end if %>


--------------------
this is really weired, it never happened beofre.

Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.43 seconds. Powered By: Snitz Forums 2000 Version 3.4.07