Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2004, 06:12 AM
Authorized User
 
Join Date: Mar 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alitoday Send a message via Yahoo to alitoday
Default admin page

suppose i am admin of my website,i can login, and manage my website via contol panal,my contral panel has web address.the problem is that any one can access my control panal via my admin 's url.i want that any normal user can not access my admin page.what should i do?

ali
__________________
ali
 
Old July 31st, 2004, 10:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Does it ask for login/password when you try to use your control panel as a admin user?

_________________________
- Vijay G
Strive for Perfection
 
Old August 3rd, 2004, 03:31 AM
Authorized User
 
Join Date: Mar 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alitoday Send a message via Yahoo to alitoday
Default

i want to say that any one can open admin's url page without admin login.how can i stop them.

ali
 
Old August 3rd, 2004, 03:46 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

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">
      &nbsp;
    </td>
  </tr>
  <tr>
     <td width="100%" valign="top" colspan="3">
      <p align="center">&nbsp;&nbsp;
     </td>
  </tr>

    <form method="POST" action="" id="form1" name="form1">

        <tr>
          <td align="middle" colspan="3"><b><%=errmsg%></b>&nbsp;&nbsp;
        </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>&nbsp;</td>
        </tr>

        <tr>
            <td width="50%" valign="top" colspan="2">&nbsp;</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">&nbsp;</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)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Redirection From Admin page stonesbg ASP.NET 2.0 Basics 3 January 10th, 2007 05:06 PM
admin login mujnu PHP How-To 0 February 5th, 2006 08:03 AM
admin youyou_hym Dreamweaver (all versions) 1 February 15th, 2005 03:03 AM
VWD Admin bmains ASP.NET 2.0 Basics 4 August 5th, 2004 05:25 PM
Admin Dan Jallits Forum and Wrox.com Feedback 1 June 6th, 2003 10:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.