Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

redirect visitor if not info on database

Posted 09 Jul 2002 18:16:09
1
has voted
09 Jul 2002 18:16:09 Alfa Siete posted:
I have a data base (acces) with all my customers info. all of them can surf the site with different privileges, passwords and usernames.
a few of them have credit in my shop. they are located in another table in my data base.
i created a balance page, so customers with credit can check debits, credits and balance when clciking on the balance button located everywhere in my site.
when customers without credit click to go to balance page i get an EOF error, since i have no record for that customer on the balance database.
i would like to direct customers with no credit who click the balance button to a message page, kind of "you don't have a credit account"
any ideas???

Everybody should belive in something... I belive i'm having another beer

Edited by - sieteyuna on 09 Jul 2002 18:17:04

Replies

Replied 09 Jul 2002 20:11:01
09 Jul 2002 20:11:01 ramy ramy replied:
try
<% IF (TWEST.RecordCount) > 0 THEN
Response.Redirect (yourmasage.html)
else
end if %>



Replied 09 Jul 2002 22:42:57
09 Jul 2002 22:42:57 aegis kleais replied:
Or you can try:

<%
Option Explicit
If rs.EOF or rs.BOF then
Dim goto
goto = Server.URLEncode("no_credit_sucka.asp"
Response.Redirect(goto)
End If
%>

This just makes sure cause if you're credit page has spaces or odd characters in it, the Server.URLEncode will change spaces to %20 and other characters to URL-supported strings before you perform a Redirect on it.

Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 11 Jul 2002 00:00:33
11 Jul 2002 00:00:33 Alfa Siete replied:
Thank you for the ideas... I will give them a try and let you know how it went...
Saludos

Everybody should belive in something... I belive i'm having another beer

Reply to this topic