B
Bill
this post is going to be a bit long but lots of code so sorry about that. My
problem is that I have a an asp page that has lots of includes. But I needed
to have a way to include certain files based on a condition. I came across
conditional SSI. I created the myprofile page below which has the
coniditional SSI. When I run the page i get a an expected END error on the
included member.asp page also below. Not sure what the problem is because its
on line 45 and there is only a response.write there and only one if statement
on the entire page. I would appreciate any help on getting this resolved.
Thanks
'********* myprofile.asp *************
<!--#include file="includes/verify.asp" -->
<!--#include file="includes/functions.asp" -->
<!--#include file="includes/header.asp" -->
<!--#include file="includes/navigation.asp" -->
<%
On Error Resume Next
Call OpenDB()
'*****////////// Recordsets /////////////************************
GetTeamSQL = "Select * from tblteams where TeamMembers ='" & strusername & "'"
Set rsGetTeam = dbConn.Execute(GetTeamSQL)
ProfileSQL = "Select * from tblmembers where UserName ='" & strusername & "'"
Set rsProfile = dbConn.Execute(ProfileSQL)
ListTeamsSQL = "Select DISTINCT Team from tblteams"
Set rsListTeams = dbConn.Execute(ListTeamsSQL)
'*****////////// END Recordsets /////////////************************
'****////////// SCRIPT FOR CONFIRMING MEMBERS - CAPTAINS ONLY
///////////////////***********
If Request.form("confirm") <> "" OR IsNull(Request.form("confirm")) Then
struser = Request.form("form_username")
If Request.form("confirm") = "Confirm" Then
confirmSQL = "Update tblteams set Active = True WHERE TeamMembers ='" &
struser & "'"
Set rsconfirm = dbConn.Execute(confirmSQL)
Elseif Request.form("confirm") = "Remove" Then
DeleteSQL = "Delete from tblteams WHERE TeamMembers ='" & struser & "'"
Set rsDelete = dbConn.Execute(DeleteSQL)
End IF
If IsObject(FORMDATA) = True Then
FORMDATA.RemoveAll 'Clear the form values
End IF
End IF
'****//////////// END OF CONFIRM MEMBER SCRIPT
/////////////////////*******************
'set a level of membership for the user on the team
If rsGetTeam.eof Then
Response.redirect("myprofile.asp?level=freeagent")
ElseIf rsGetTeam("Captain")= True Then
Response.redirect("myprofile.asp?level=Captain")
ElseIf rsGetTeam("CoCaptain") = True Then
response.redirect("myprofile.asp?level=CoCaptain")
ElseIf rsGetTeam("Active") = False Then
response.redirect("myprofile.asp?level=Pending")
Else
response.redirect("myprofile.asp?level=member")
End If
%>
'*********conditional SSI *************************
<!--#if expr="${QUERY_STRING} = /level=freeagent/" -->
<!--#include file="includes/freeagent.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=captain/" -->
<!--#include file="includes/captain.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=cocaptain/" -->
<!--#include file="includes/cocaptain.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=pending/" -->
<!--#include file="includes/pending.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=member/" -->
<!--#include file="includes/member.asp" -->
<!--#endif -->
<!--#include file="includes/footer.asp" -->
'********member.asp*************
<table width="100%" border="0" cellpadding="3">
<tr>
<td colspan="3"><div align="center">Profile: <%=strusername%></div></td>
</tr>
<tr>
<td width="19%"><div align="right">Team:</div></td>
<td width="41%"><%=rsGetTeam("Team")%></td>
<td width="40%"><div align="center">Team
Members(<%=CountTeamMembers(rsGetTeam("Team"))%>)</div></td>
</tr>
<tr>
<td><div align="right">Motto:</div></td>
<td><%=rsGetTeam("Motto")%>
<td rowspan="8" valign="top"><p align="center">::: Cornfirmed :::</p>
<p>
<%
If not rsCountTeamMembers.eof Then
While Not rsCountTeamMembers.eof
Response.Write(rsCountTeamMembers("TeamMembers") + "<br>")
rsCountTeamMembers.movenext
WEND
End If
%>
</p>
<p align="center"> </p>
<p align="center"> </p></td>
</tr>
<tr>
<td><div align="right">Description:</div></td>
<td><%=rsGetTeam("Description")%></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right">Name:</div></td>
<td><%=rsProfile("First") & " " & rsProfile("Last")%></td>
</tr>
<tr>
<td><div align="right">XBox Live Tag:</div></td>
<td><%=strusername%></td>
</tr>
<tr>
<td><div align="right">E-mail:</div></td>
'************line 45 ********************
<td><%=rsProfile("Email")%></td>
</tr>
<tr>
<td> </td>
<td>
</tr>
<tr>
<td> </td>
<td>
</tr>
</table>
problem is that I have a an asp page that has lots of includes. But I needed
to have a way to include certain files based on a condition. I came across
conditional SSI. I created the myprofile page below which has the
coniditional SSI. When I run the page i get a an expected END error on the
included member.asp page also below. Not sure what the problem is because its
on line 45 and there is only a response.write there and only one if statement
on the entire page. I would appreciate any help on getting this resolved.
Thanks
'********* myprofile.asp *************
<!--#include file="includes/verify.asp" -->
<!--#include file="includes/functions.asp" -->
<!--#include file="includes/header.asp" -->
<!--#include file="includes/navigation.asp" -->
<%
On Error Resume Next
Call OpenDB()
'*****////////// Recordsets /////////////************************
GetTeamSQL = "Select * from tblteams where TeamMembers ='" & strusername & "'"
Set rsGetTeam = dbConn.Execute(GetTeamSQL)
ProfileSQL = "Select * from tblmembers where UserName ='" & strusername & "'"
Set rsProfile = dbConn.Execute(ProfileSQL)
ListTeamsSQL = "Select DISTINCT Team from tblteams"
Set rsListTeams = dbConn.Execute(ListTeamsSQL)
'*****////////// END Recordsets /////////////************************
'****////////// SCRIPT FOR CONFIRMING MEMBERS - CAPTAINS ONLY
///////////////////***********
If Request.form("confirm") <> "" OR IsNull(Request.form("confirm")) Then
struser = Request.form("form_username")
If Request.form("confirm") = "Confirm" Then
confirmSQL = "Update tblteams set Active = True WHERE TeamMembers ='" &
struser & "'"
Set rsconfirm = dbConn.Execute(confirmSQL)
Elseif Request.form("confirm") = "Remove" Then
DeleteSQL = "Delete from tblteams WHERE TeamMembers ='" & struser & "'"
Set rsDelete = dbConn.Execute(DeleteSQL)
End IF
If IsObject(FORMDATA) = True Then
FORMDATA.RemoveAll 'Clear the form values
End IF
End IF
'****//////////// END OF CONFIRM MEMBER SCRIPT
/////////////////////*******************
'set a level of membership for the user on the team
If rsGetTeam.eof Then
Response.redirect("myprofile.asp?level=freeagent")
ElseIf rsGetTeam("Captain")= True Then
Response.redirect("myprofile.asp?level=Captain")
ElseIf rsGetTeam("CoCaptain") = True Then
response.redirect("myprofile.asp?level=CoCaptain")
ElseIf rsGetTeam("Active") = False Then
response.redirect("myprofile.asp?level=Pending")
Else
response.redirect("myprofile.asp?level=member")
End If
%>
'*********conditional SSI *************************
<!--#if expr="${QUERY_STRING} = /level=freeagent/" -->
<!--#include file="includes/freeagent.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=captain/" -->
<!--#include file="includes/captain.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=cocaptain/" -->
<!--#include file="includes/cocaptain.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=pending/" -->
<!--#include file="includes/pending.asp" -->
<!--#elif expr="${QUERY_STRING} = /level=member/" -->
<!--#include file="includes/member.asp" -->
<!--#endif -->
<!--#include file="includes/footer.asp" -->
'********member.asp*************
<table width="100%" border="0" cellpadding="3">
<tr>
<td colspan="3"><div align="center">Profile: <%=strusername%></div></td>
</tr>
<tr>
<td width="19%"><div align="right">Team:</div></td>
<td width="41%"><%=rsGetTeam("Team")%></td>
<td width="40%"><div align="center">Team
Members(<%=CountTeamMembers(rsGetTeam("Team"))%>)</div></td>
</tr>
<tr>
<td><div align="right">Motto:</div></td>
<td><%=rsGetTeam("Motto")%>
<td rowspan="8" valign="top"><p align="center">::: Cornfirmed :::</p>
<p>
<%
If not rsCountTeamMembers.eof Then
While Not rsCountTeamMembers.eof
Response.Write(rsCountTeamMembers("TeamMembers") + "<br>")
rsCountTeamMembers.movenext
WEND
End If
%>
</p>
<p align="center"> </p>
<p align="center"> </p></td>
</tr>
<tr>
<td><div align="right">Description:</div></td>
<td><%=rsGetTeam("Description")%></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align="right">Name:</div></td>
<td><%=rsProfile("First") & " " & rsProfile("Last")%></td>
</tr>
<tr>
<td><div align="right">XBox Live Tag:</div></td>
<td><%=strusername%></td>
</tr>
<tr>
<td><div align="right">E-mail:</div></td>
'************line 45 ********************
<td><%=rsProfile("Email")%></td>
</tr>
<tr>
<td> </td>
<td>
</tr>
<tr>
<td> </td>
<td>
</tr>
</table>