CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Authentication Using IP Address

Print topic Send  topic

Author Message
kitto

Posts: 3
Posted: 06/18/2006, 8:46 AM

Hi,

I need help i.e. how to modify login page so that beside authenticating username/ password it also look into a table in SQL database which include the allowable IP Address and if IP is not found, it redirects to another page.

I am not coder therefore appreciate if you help me to achieve it in CodeCharge 2.3.

Thanks for your help.

Kitto
View profile  Send private message
Edd


Posts: 547
Posted: 06/18/2006, 7:58 PM

Kitto,
You will need to be a coder to do this.

Very Roughly - In the After Initialize event you will need to add something like.
  
Dim RemAddr  
Dim CountIsItThere  
Dim DBConn  
RemAddr = Request.ServerVariables("REMOTE_ADDR")  
  
DBConn = new clsDBNameOfDatabase  
DBConn.Open  
CountIsItThere = CCDLookup("Count(*)","IPADDRESSTABLE","'" & RemAddr & "' Between StartIPAddress And EndIPAddress", DBConn)  
  
DBConn.Close  
Set DBConn = nothing  
' Redirecting if the IPAddress doesn't exist  
If CountIsItThere = 0 Then  
      Unloadpage  
      Response.Redirect "whatever.asp"  
      Response.End  
End If  

Note when testing IP addresses depending on your set up, you will need to test for ranges.

Don't know what you are doing but you you are looking at a messy solution, as maintenance and changes in IP addresses will get to you in the long run.

Edd
_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.