Date:  01/24/2006 06:35:10 PM Msg ID:  002823
From:  FoxWeb Support Thread:  002821
Subject:  Re: Can I redirect a page like this?
Your code does not work, because you placed the Response.Redirect command outside the code delimiters.  It should look like this instead:
 

...

If _Tally>0
    response.redirect("new_page.fwx")
ELSE

...

 
By the way, even though the Response.Redirect command will work, I recommend that you use Server.Transfer, or Server.Execute instead.  Response.Redirect sends an HTTP redirect header to the browser, so it requires an extra round-trip.
 
I assume that you are not using the Auth object for authentication right?  Is there a reason for this?  We have put a lot of work in making the Auth object really secure and easy to use.

FoxWeb Support Team
support@foxweb.com email

Sent by Larry Zhang on 01/24/2006 10:26:25 AM:
Can I switch to a new page if user id is found?

<%
set step on
m.action="login.fwx"
IF Request.FormCount("User_id") <> 0


 SELECT * FROM User ;
   WHERE UPPER(Allt(Code)) == UPPER(Allt(Request.Form("User_ID"))) ;
   INTO CURSOR results

 

 If _Tally>0
    %>response.redirect("new_page.fwx")<%
 ELSE
  %><h4><center> Sorry. User ID or Password is not correct. </center></h4><%
 ENDIF
ENDIF
%>

 

<form action="login.fwx" method="post">
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="User_id" maxlength="30" value="<%=Request.Form("User_ID")%>" size="20">
<input type="image" src="images/btnNext.gif" height="15" width="15">
</p>
</form>
<hr>
</body>
</html>

It seems the respons.redirect line does not work. What command shall I use. Thank you in advance.