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)
 Need ASP Coding Help...Anyone?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

JGonier
Starting Member

USA
44 Posts

Posted - 07 June 2001 :  04:44:20  Show Profile  Visit JGonier's Homepage
How can I make this code work the way I want it to.

<font class="nu"><b>
<% If Session("Authenticated") = 0 Then %>
<p align="center"><font class="nu2"><font color="#FF0000"><b>The Employees Only section requires Login.</b></font></font></p>
<p align="center">Sorry, But The Login ID Or Password You Supplied Are Either Incorrect Or Do Not Exist.</p>
<p align="center">Please Try Your Login Again.</p>
<meta http-equiv="Refresh" content="5; URL=<% =Request.ServerVariables("HTTP_REFERER") %>">
<% Else %>
<% If Session("Authenticated") = 1 Then %>
<p align="center">You Have Logged On Successfully!</p>
<meta http-equiv="Refresh" content="2; URL=http://www.mywebsite.com/employees/index.asp">
<% End If %>
<% Response.End %>
<% End If %>
</b></font>


The problem I am having is this.

When login is incorrect you get the error message in the first IF statement and then redirects back to the login page like it should, but if you type in the right information, you get the message in the second IF statement like you should but it does not redirect to the page I want. It just redirects back to the login page from the first IF statement.

What am I doing wrong with this code?

Can someone help me figure this out? I have been messing with it for about 4 hours now.

Thanks in advance.


Sincerely,
JGonier

e3stone
Average Member

USA
885 Posts

Posted - 07 June 2001 :  06:07:31  Show Profile  Send e3stone an AOL message
your code looks good. I tried it by replacing some of the variable values:

<% x=0 %>
<% If x = 0 Then %>
<p align="center">

<font color="#FF0000"><b>The Employees Only section requires Login.</b></font>

</p>
<p align="center">Sorry, But The Login ID Or Password You Supplied Are Either Incorrect Or Do Not Exist.</p>
<p align="center">Please Try Your Login Again.</p>
<meta http-equiv="Refresh" content="5; URL=http://www.espn.com">
<% Else %>
<% If x = 1 Then %>
<p align="center">You Have Logged On Successfully!</p>
<meta http-equiv="Refresh" content="2; URL=http://www.mywebsite.com/employees/index.asp">
<% End If %>
<% Response.End %>
<% End If %>

and it worked.

http://www.mywebsite.com/employees/index.asp doesn't happen to be the page with the login on it, would it?



<-- Eric -->


InsideWaco.com
Go to Top of Page

JGonier
Starting Member

USA
44 Posts

Posted - 07 June 2001 :  13:33:27  Show Profile  Visit JGonier's Homepage
It's amazing how you can figure out things after getting a good nights sleep.

I figured out what my problem was. When I first started with this page I had something else in mind (just a redirect after a message) and I had left this
<meta http-equiv="Refresh" content="5; URL=<% =Request.ServerVariables("HTTP_REFERER") %>">

in the header of this page.

So what happend then was even though the login was correct and I was getting the correct messages, that redirect was already sent in the header, thus the redirect I was using in the 2nd IF statement was being over-ridden.

Thanks for the help though, e3stone.

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