Re: How do you display html page with one cond. but not with other

Re: How do you display html page with one cond. but not with other

am 19.11.2004 19:49:23 von raydan

Either add a Response.End immediately after :
Clik here

Or move "End If" to the end of your code.

"Jack" wrote in message
news:0C299966-1831-4392-BEFC-F3F9918562EE@microsoft.com...
> Hi, I have code where I would like to display the contents of HTML stuff
if
> one condition is satisfied and not when the other condition is satisfied
(but
> error message)i.e. when Session("authenticated") = False then I do not
want
> to display HTML contents. How does one do that? Presently, the HTML
contents
> are being displayed with either of the if cases. Thanks for any help.
> CODE:
> strSQL = "select PeopleNameFirst, PeopleNameLast, PeopleClubCode from
People
> where " & _
> "PeopleNameFirst ='" & Request.Form("txtFirstName") & "' AND " & _
> "PeopleNameLast ='" & Request.Form("txtLastName") & "' AND " & _
> "PeopleClubCode ='" & Request.Form("txtPassword") & "'"
> 'Response.Write strSQL
> RS.Open strSQL
> %>
> 'Check for empty recordset which indicates user information was not found
> <%
> If RS.EOF or RS.BOF Then
> Session("Authenticated") = False
> %>
> Sorry, your userid or password did not match
or you have not
registerd
> yet. Please register.
>
Clik here
> <%
> Else
> Session("Authenticated") = True
> Response.Cookies("Sailors")("FirstName") = Request.Form("txtFirstName")
> Response.Cookies("Sailors")("LastName") = Request.Form("txtLastName")
> Response.Cookies("Sailors")("Password") = Request.Form("txtPassword")
> Response.Cookies("Sailors").expires = Date + 365
> End If
>
>
>
>
> Sailors Web Site
>
>
>


> Sailors Case Study
>

>


>
>
>
> %>

How do you display html page with one cond. but not with other

am 19.11.2004 19:55:08 von jack

Hi, I have code where I would like to display the contents of HTML stuff if
one condition is satisfied and not when the other condition is satisfied (but
error message)i.e. when Session("authenticated") = False then I do not want
to display HTML contents. How does one do that? Presently, the HTML contents
are being displayed with either of the if cases. Thanks for any help.
CODE:
strSQL = "select PeopleNameFirst, PeopleNameLast, PeopleClubCode from People
where " & _
"PeopleNameFirst ='" & Request.Form("txtFirstName") & "' AND " & _
"PeopleNameLast ='" & Request.Form("txtLastName") & "' AND " & _
"PeopleClubCode ='" & Request.Form("txtPassword") & "'"
'Response.Write strSQL
RS.Open strSQL
%>
'Check for empty recordset which indicates user information was not found
<%
If RS.EOF or RS.BOF Then
Session("Authenticated") = False
%>
Sorry, your userid or password did not match
or you have not registerd
yet. Please register.
Clik here
<%
Else
Session("Authenticated") = True
Response.Cookies("Sailors")("FirstName") = Request.Form("txtFirstName")
Response.Cookies("Sailors")("LastName") = Request.Form("txtLastName")
Response.Cookies("Sailors")("Password") = Request.Form("txtPassword")
Response.Cookies("Sailors").expires = Date + 365
End If




Sailors Web Site



Sailors Case Study







%>

Re: How do you display html page with one cond. but not with other

am 19.11.2004 21:04:15 von jeff.nospam

On Fri, 19 Nov 2004 10:55:08 -0800, "Jack"
wrote:

>Hi, I have code where I would like to display the contents of HTML stuff if
>one condition is satisfied and not when the other condition is satisfied (but
>error message)i.e. when Session("authenticated") = False then I do not want
>to display HTML contents. How does one do that? Presently, the HTML contents
>are being displayed with either of the if cases. Thanks for any help.

If Session = "Authenticated" THEN

..... Display all the HTML ....

END IF

You could also do:

If Session = "Authenticated" THEN

..... Display the page items ...

ELSE

..... Display a message that they aren't suthenticated and direct them
to the sign-in page ...

END IF

Jeff

>CODE:
>strSQL = "select PeopleNameFirst, PeopleNameLast, PeopleClubCode from People
>where " & _
>"PeopleNameFirst ='" & Request.Form("txtFirstName") & "' AND " & _
>"PeopleNameLast ='" & Request.Form("txtLastName") & "' AND " & _
>"PeopleClubCode ='" & Request.Form("txtPassword") & "'"
>'Response.Write strSQL
>RS.Open strSQL
>%>
>'Check for empty recordset which indicates user information was not found
><%
>If RS.EOF or RS.BOF Then
> Session("Authenticated") = False
>%>
> Sorry, your userid or password did not match
or you have not registerd
> yet. Please register.
>
Clik here
><%
>Else
> Session("Authenticated") = True
> Response.Cookies("Sailors")("FirstName") = Request.Form("txtFirstName")
> Response.Cookies("Sailors")("LastName") = Request.Form("txtLastName")
> Response.Cookies("Sailors")("Password") = Request.Form("txtPassword")
> Response.Cookies("Sailors").expires = Date + 365
>End If
>
>
>
>
>Sailors Web Site
>
>
>


> Sailors Case Study
>

>


>
>
>
>%>