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
Author Previous Topic Topic Next Topic
Page: of 5

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 27 March 2001 :  12:32:03  Show Profile
Ok, I'm at a loss. The code looks ok. Even tried it myself, copied and pasted your code and I got the "Start Gambling" text.

Gor, you have any ideas?

The only thing I can ask you to try is copy the "Response.Write" code I gave you and put it after the elseif betgold > nowgold then statement, but before the msgbox code. It will print out the numbers in the variables. You might want to comment out the "location.href" code in the msgbox so that it won't redirect before you can see the text.
So after doing that modification, you should have something looking like this:
elseif betgold > nowgold then
Response.Write("betgold is: " & betgold & "<br>nowgold is: " & nowgold)
%>
<script language=vbscript>
MsgBox "Sorry, you don't have enough gold "
'location.href = "javascript:history.back(1)"
</script>
<%
else
Let me know what you get.

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 27 March 2001 :  16:22:10  Show Profile
i changed the code to this

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

if strDBNTUserName = "" then
doNotLoggedInGame
else

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_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_GOLD "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_REP "
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 & " WHERE MEMBER_ID=" & Request.QueryString("id")




set rs = my_Conn.Execute (strSql)


dim betgold,nowgold
nowgold = 0
betgold = 0
nowgold = rs("M_GOLD")
nowrep= rs("M_REP")

betgold=request.form("game1")
Response.Write("betgold is: " & betgold & "<br>nowgold is: " & nowgold)
if betgold <= 0 then
%>
<script language=vbscript>
MsgBox "Error, no gold!"
location.href = "javascript:history.back(1)"
</script>
<%
elseif betgold > 100 then

%>
<script language=vbscript>
MsgBox "Error, MAX. 100 Gold"
location.href = "javascript:history.back(1)"
</script>
<%
elseif nowrep < 5 then

%>
<script language=vbscript>
MsgBox "Sorry, not enough rep. point."
location.href = "javascript:history.back(1)"
</script>
<%
betgold=request.form("game1")

elseif betgold < 100 then
Response.Write("betgold is: " & betgold & "<br>nowgold is: " & nowgold)

%>
<script language=vbscript>
<%Response.Write("betgold is: " & betgold & "<br>nowgold is: " & nowgold) %>
MsgBox "Sorry, you don't have enough gold "
<%Response.Write("betgold is: " & betgold & "<br>nowgold is: " & nowgold) %>
'location.href = "javascript:history.back(1)"
</script>
<%
else


%>

Start gambling

<%

end if



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



then i got this
betgold is: 60
nowgold is: 100betgold is: 60
nowgold is: 100

am i suppose to get 6 msg not just 4? this is really weired

---------------heres the code for (game1_main.asp)-----------this is where you input the number---

<!--#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_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_GOLD "
strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_REP "
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 & " WHERE MEMBER_ID=" & Request.QueryString("id")




set rs = my_Conn.Execute (strSql)


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>
 <p>
<br>
</p>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="55%" id="AutoNumber1">
<tr>
<td width="60%" align="center" valign="top" bgcolor="#99FFCC"><b>
<font size="5">Game 1</font></b></td>
</tr>
<tr>
<td width="60%" align="center" valign="top" bgcolor="#FFFFFF"><b>You have <% =rs("M_GOLD")%> Gold</b></td>
</tr>
<tr>
<td width="100%" align="center" valign="top" bgcolor="#CCFFCC">Place your bet here.</td>
</tr>
<tr>
<td width="100%" align="center" valign="top">
</td>
</tr>
<tr>
<td width="100%" align="center" valign="top">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<tr>
<td width="10%" bgcolor="#FFFFCC"> </td>
<td width="80%" align="center"> <form method="POST" action="game1_post.asp?id=<% = getMemberNumber(STRdbntUserName) %>">
<p>
<font color="#FF0000">max. 100 gold</font></p>
<p>
<input type="text" name="game1" size="15" value="0" > Gold</p>
<p>
<input type="submit" value="Submit" name="B1"> <input type="reset" value="Reset" name="B2"></p>
</form></td>
<td width="10%" bgcolor="#FFFFCC"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" align="center" valign="top"><font color="#FF0000"><b>
Caution: </b></font>You will lose 1 reputation point each time you gamble</td>
</tr>
</table>

</center>
</div>



<p> </p>




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

-------------------------------
you just need to add 2 new columes to your FORUM_MEMBERS table. M_GOLD, M_REP, to run this page.

Thanks a lot for helping me Davio =)


Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 03 April 2001 :  21:10:29  Show Profile
how do i get the number of the total members?

is there a variable for that?

thanks

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 05 April 2001 :  13:16:45  Show Profile
It's in the FORUM_TOTALS table called U_COUNT. (stands for USER COUNT) That will tell you the total number of members.

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 08 April 2001 :  13:04:06  Show Profile
you for the active user thing, it tells where the user is. (ex:Viewing Message ' I have a Great idea! ') where is the code that tell you where the user is right now?

thx

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 11 April 2001 :  17:43:45  Show Profile
last question:
im not very familiar with sql syntax,

i wanna make the exsiting value of M_GOLD - the variable betgold

the problem is at the last part of the code
( - "& betgold"),
i know the rest is correct because i just copied it from snitz forum's code.

strSql = strSql & " SET " & strMemberTablePrefix & "MEMBERS.M_GOLD = " & strMemberTablePrefix & "MEMBERS.M_GOLD" - "& betgold"

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 12 April 2001 :  15:44:01  Show Profile
quote:
strSql = strSql & " SET " & strMemberTablePrefix & "MEMBERS.M_GOLD = " & strMemberTablePrefix & "MEMBERS.M_GOLD" - "& betgold"

It would look something like this:

strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " SET M_GOLD = " & betgold
strSql = strSql & " WHERE MEMBERS_ID = '" & Members_ID & "'"

You would need the members id or something to identify which members M_GOLD you want updated.

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 12 April 2001 :  18:49:01  Show Profile
sorry Davio i should have explained this better, what i wanna do is:

M_GOLD minus the value of betgold, both of them are numeric

strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " SET " & strMemberTablePrefix & "MEMBERS.M_REP = " & strMemberTablePrefix & "MEMBERS.M_REP - 1 "

strsql = strsql & ", " & strMemberTablePrefix & "MEMBERS.M_GTOTAL = " & strMemberTablePrefix & "MEMBERS.M_GTOTAL + 1 "

strSql = strSql & " WHERE MEMBER_ID=" & getMemberNumber(STRdbntUserName)


this is what i have now, only the line in bold needs to be fixed, the rest are fine.

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 12 April 2001 :  20:54:57  Show Profile
Ohhh, ok. Then changing the sql statement i posted before you would have this:
strSql = strSql & " SET M_GOLD = M_GOLD - " & betgold


For the sql statment, you would change it to this:
strSql = "UPDATE " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & " SET M_REP = M_REP - 1 "
strsql = strsql & ", M_GTOTAL = M_GTOTAL + 1 "
strSql = strSql & " WHERE MEMBER_ID=" & getMemberNumber(STRdbntUserName)
Once you have the "UPDATE MEMBERS" part, the database is already looking in the "MEMBERS" table, so you don't need to repeat the "& strMemberTablePrefix &" over again. Same thing for the M_GOLD sql statement.

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 13 April 2001 :  13:07:39  Show Profile
Thanks =)

Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 26 April 2001 :  15:49:38  Show Profile
hey guys my mods are done, i installed them on my friend's forum, go have a look.

www.meatsocks.com

Go to Top of Page
Page: of 5 Previous Topic Topic Next Topic  
Previous 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.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07