dbWriter Home
IP to Country Look up
Site Map

IP to Country DB

Free Databases:

ASP Code

ASP Links

VB Script functions:
Array
Case/Select
In String (inStr)
Replace

HTML code:
SELECT Color
SELECT Countries
SELECT Language
SELECT State/Province

SQL:

SQL Functions:
Delete leading Char
Get Browser
Long number from IP

Stored Procedures:

SQL Tricks:
Delete ALL duplicates
Delete dup records

MISC
IP Address Owner
MS SQL Server

Mortgage Calcs:
how much is my payment
Loan Amortization
Loan Calculator
Mortgage Calculator
Motrgage Pay Off

dbWriter License

Link to US

Links

Contact US
 

dbWriter Simple Log IN / Page protection ASP code

NOTE:  Point all hyperlinks to the protected page and the code at the top of the page will redirect to the login script if NOT logged in.  This script uses a Session variable so you will stay logged in until you close your browser.

Test LogIN code

Not Logged in!!

<%@ Language=VBScript%>
<% Option Explicit %>
<%
'**********************************
'
' Point all hyperlinks to the protected page the next code line will redirect if not logged in.
'
' This next line goes at the head of page to be protected.  NOT this login page!!
'
' IF Session("user") <> "LogedON" THEN response.redirect("login.asp")
'
'**********************************

Response.Buffer=True
on error resume next

DIM Uname
DIM Pass
DIM msgclr
DIM msg

Uname = trim(request.form("User_Name"))
Pass = trim(request.form("Password"))

If Uname = "" and Pass = "" then
msgclr = "#000000"
msg = "Enter your user name and password below!"
Session("user") = ""

ElseIf Uname = "" or Pass = "" then
msgclr = "#FF0000"
msg = "User Name or Password entered is incorrect!"
Session("user") = ""

ElseIf Uname = "test" and Pass = "test" then '<--- Enter User name and password here
Session("user") = "LogedON"
response.redirect("YourProtectedPage.asp") '<--- Enter redirect here

Else
msgclr = "#FF0000"
msg = "User Name or Password entered is incorrect!"
Session("user") = ""

End If

%>
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body>
<p align="center">&nbsp;</p>
<form name="form1" method="post" action="">

<div align="center">
<center>
<table width="401" border="1" cellspacing="1" bordercolor="#000000">
<tr>
<td width="393" align="center" colspan="2" nowrap>
<font color="<%=msgclr%>"><%=msg%></font>&nbsp;</td>
</tr>
<tr>
<td width="128" align="left">
<p align="left">User Name:</td>
<td width="264" align="center">
<font color="#FFFFFF">
<input name="User_Name" type="text" id="username" size="42"></font></td>
</tr>
<tr>
<td width="128" align="left">
<p align="left">Password:</td>
<td width="264" align="center">
<font color="#FFFFFF">
<input name="Password" type="password" id="password" size="42"></font></td>
</tr>
<tr>
<td width="393" colspan="2" align="center">
<p align="center"><font color="#FFFFFF"><input type="submit" name="Submit" value="Submit"></font></td>
</tr>
</table>
</center>
</div>
</form>
<p align="center"></p>
</body>
</html>

Partners/Links © 2005 - 2008 dbWriter.com All Rights Reserved
This site is protected by the dbWriter IPtoCountry MS/SQL database!!
Site map | Link to US
Contact Us

Sign up for PayPal and start accepting credit card payments instantly.