Are you using asp pages?
If you are use asp please follow the step
-------------------------page name=default.asp--------<%
userid=replace(Request("userid"),"'","''")
password=replace(Request("password"),"'","''")
mode=Request("mode")
if mode="add" then
uniqueusername="suren"
uniquePassword="TnmLkok163"
if uniqueusername<>userid then
errmsg="Invalid User Name"
elseif lcase(trim(password))<>lcase(uniquePassword)then
errmsg="Invalid Password "
else
session("User")=userid
Response.Redirect ("home.asp")
end if
end if
%>
<html>
<head>
<title>Admin Login</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<script language="javascript">
function go()
{
if(document.form1.userid.value=="")
{
alert("Enter Your UserID!");
document.form1.userid.focus();
}
else if(document.form1.password.value=="")
{
alert("Enter Your Password!");
document.form1.password.focus();
}
else
{
document.form1.mode.value="add";
document.form1.action="default.asp"
document.form1.submit()
}
}
//-->
</script>
</head>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top" colspan="3">
</td>
</tr>
<tr>
<td width="100%" valign="top" colspan="3">
<p align="center">
</td>
</tr>
<form method="POST" action="" id="form1" name="form1">
<tr>
<td align="middle" colspan="3"><b><%=errmsg%></b>
</tr>
<tr>
<td align="middle" width="25%">
<p align="center"></p>
</td>
<td align="middle" width="25%">User ID</td>
<td align="left" width="50%"><input type=text value="<%=userid%>" maxLength="30" name="userid" size="25"></td>
</tr>
<tr>
<td align="middle" width="25%">
<p align="center"></p>
</td>
<td align="middle" width="25%" valign="top">Password</td>
<td align="left" width="50%"><input maxLength="30" name="password" size="25" value="<%=password%>" type="password" ><br> </td>
</tr>
<tr>
<td width="50%" valign="top" colspan="2"> </td>
<td width="50%" valign="top">
<input type="button" value=" Submit " name="submit1" onclick="go()">
<input type="hidden" name="mode">
</td>
</tr>
</form>
<tr>
<td width="100%" valign="top" colspan="3"> </td>
</tr>
</table>
------------------------
Please call all your pages the following code
<%
if session("User")= Empty or (session("User") = "" or isnull(session("User"))) then
Response.Redirect ("default.asp")
End if
%>
surendran
(Anything is Possible)
|