Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with if-then-else stuff

Status
Not open for further replies.

gouber82

Programmer
Joined
Oct 12, 2003
Messages
5
Location
US
I have simplified my code to what is below, I am trying to have nested if statements. You can see that I have 3 levels basically. I have the end if statements for each block of if statements, but I think that the server is still reading them as one if statement. I have tried {}, but asp does not like those. Any suggestions would be appreciated.

Thanks,
Travis

******
*code*
******
if ( username = "" Or password = "" ) then
%>
<h3>Unauthorized Access You Must Login</h3><br>
<%
else if ( pass <> password ) then
%>
<h3>Invalid Username or Password</h3><br>
<%
else if ( uAccess = &quot;admin&quot; ) then
%>
<h3>Admin</h3><br>
<%
elseif ( uAccess = &quot;user&quot; ) then
%>
<h3>User</h3><br>
<%
else
%>
<h3>Guest</h3>
<%
end if
end if
end if
 
GRRRRRRRR, don't you just hate it when you figure out the answer just after you ask the question. I made a stupid mistake and was not getting the right variable passed from the previous page. It all works now.

Later,
Travis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top