Click here to Skip to main content
15,914,222 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHow to improve security? Pin
zhoujun22-Sep-02 2:25
zhoujun22-Sep-02 2:25 
AnswerRe: How to improve security? Pin
Martin Haesemeyer22-Sep-02 6:45
Martin Haesemeyer22-Sep-02 6:45 
GeneralRe: How to improve security? Pin
zhoujun22-Sep-02 21:09
zhoujun22-Sep-02 21:09 
GeneralWeb.config Pin
Rickard Andersson2021-Sep-02 23:45
Rickard Andersson2021-Sep-02 23:45 
GeneralRe: Web.config Pin
Uwe Keim22-Sep-02 0:48
sitebuilderUwe Keim22-Sep-02 0:48 
Generalpls help me Pin
Anonymous20-Sep-02 20:11
Anonymous20-Sep-02 20:11 
GeneralRe: pls help me Pin
Stephane Rodriguez.20-Sep-02 21:57
Stephane Rodriguez.20-Sep-02 21:57 
GeneralSorry this Login Script Version Pin
User 4886920-Sep-02 7:07
User 4886920-Sep-02 7:07 
Hello all, this is my login script but Im having trouble sending it to the "action="checklogin.aspx" page. I used to use ASP 3.0 and I think the concept of this may have changed and I'm overlooking something very simple Can anyone help the 2 pages are below:

login.aspx....
--------------------------------------------------
<script language="c#" runat="server">
void Page_Load()
{
welcomeNote.Text = "<center><b>Please enter your Username and Password to login to the GDCLTD Admin System:</b></center>";
}
</script>
<html>
<head>
<title>GDCLTD ASP.NET BETA</title>
</head>

<body>

<asp:label id="welcomeNote" runat="server" />
<br / >
<center><br /><br /><a href="index.asp"><img src="images/earthlogo.jpeg" height="230" width="194" alt="Global Development Consultancy Limited logo"border="0"></a></center>
<br /><br /><p><center><a href="http://www.gdcltd.net">http://www.gdcltd.net</a></center></p>
<br />

<center>
<form action="checklogin.asp" method="post" id="frmLogin" runat="server">
<asp:Table id="loginTable" border="1" width="25%" runat="server">
<asp:TableRow>
<asp:TableCell>
<center>
<br />
<br />
Username: <asp:textbox id="username" runat="server" size="18" runat="server"/>
<br />
Password: <asp:textbox id="password" runat="server" size="18" runat="server" />
</center>
<br />
<br />
<center>
<input type="Submit" Value="Login">
<input type="RESET">
</center>
<br />
<br />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>
</center>



</body>

</html>

------------------------------------------------
checklogin.aspx
------------------------------------------------
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script language="c#" runat="server">

void Page_Load()
{
string strConnection = "Provider=Microsoft.Jet.OleDb.4.0;";
strConnection += @"Data Source=C:\gdcltdDotNet\gdcltd.mdb";

string strUsername = Request.Form["username"]; //get username from login.aspx
string strPassword = Request.Form["password"]; //get password from login.aspx

string strSQL = "SELECT * FROM tbl_users WHERE username = '" + strUsername + "';";

//try and make connection

try
{
OleDbConnection objConn = new OleDbConnection(strConnection);
OleDbCommand objCommand = new OleDbCommand(strSQL, objConn);
OleDbDataReader objReader = null;

objConn.Open(); //open connection to database
objReader = objCommand.ExecuteReader();

while (objReader.Read() == true)
{
if(objReader["username"].ToString() == strUsername)
{
if(objReader["password"].ToString() == strPassword) // username and password match
{
Response.Write("Details correct");
}
}
}
objReader.Close();
objConn.Close();



}
catch(Exception e)
{
Response.Write(e.Message); //write error message
}



}
</script>
<html>
<body>
</body>
</html>
-------------------------------------------------
If anyone knows how this could be done better or used in one page or something, can you let me know as I'm just starting out in asp.net Smile | :)

-- modified 19-Aug-21 21:01pm.
GeneralRe: Sorry this Login Script Version Pin
Enrico Elizar Samuel21-Sep-02 4:59
Enrico Elizar Samuel21-Sep-02 4:59 
GeneralRe: Sorry this Login Script Version Pin
Rickard Andersson2021-Sep-02 23:38
Rickard Andersson2021-Sep-02 23:38 
GeneralRe: Sorry this Login Script Version Pin
User 4886922-Sep-02 6:50
User 4886922-Sep-02 6:50 
Generallogin script Pin
User 4886920-Sep-02 7:05
User 4886920-Sep-02 7:05 
GeneralWierd Problem Pin
John Pepper20-Sep-02 5:27
John Pepper20-Sep-02 5:27 
GeneralRe: Wierd Problem Pin
Paul Watson20-Sep-02 5:47
sitebuilderPaul Watson20-Sep-02 5:47 
GeneralRe: Wierd Problem Pin
akula20-Sep-02 6:09
akula20-Sep-02 6:09 
GeneralRe: Wierd Problem Pin
akula20-Sep-02 13:06
akula20-Sep-02 13:06 
GeneralButton Onclick does not work! Pin
George Ma20-Sep-02 2:19
George Ma20-Sep-02 2:19 
GeneralRe: Button onclick does not work! Pin
Paul Watson20-Sep-02 3:29
sitebuilderPaul Watson20-Sep-02 3:29 
GeneralRe: Button onclick does not work! Pin
George Ma27-Sep-02 4:02
George Ma27-Sep-02 4:02 
GeneralRe: Button onclick does not work! Pin
Megan Forbes22-Sep-02 9:41
Megan Forbes22-Sep-02 9:41 
GeneralRe: Button onclick does not work! Pin
George Ma27-Sep-02 4:11
George Ma27-Sep-02 4:11 
GeneralFind Pin
Anonymous20-Sep-02 1:12
Anonymous20-Sep-02 1:12 
QuestionHow to use JSP or Javascript to get resolution rate? Pin
George Ma19-Sep-02 19:22
George Ma19-Sep-02 19:22 
AnswerRe: How to use JSP or Javascript to get resolution rate? Pin
Paul Watson19-Sep-02 21:19
sitebuilderPaul Watson19-Sep-02 21:19 
GeneralRe: How to use JSP or Javascript to get resolution rate? Pin
George Ma20-Sep-02 2:37
George Ma20-Sep-02 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.