Click here to Skip to main content
15,909,332 members
Home / Discussions / Web Development
   

Web Development

 
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 
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 
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....
--------------------------------------------------

void Page_Load()
{
welcomeNote.Text = "<center><b>Please enter your Username and Password to login to the GDCLTD Admin System:</b></center>";
}



<title>GDCLTD ASP.NET BETA




<asp:label id="welcomeNote" runat="server">







http://www.gdcltd.net







<asp:table id="loginTable" border="1" width="25%" runat="server">
<asp:tablerow>
<asp:tablecell>





Username: <asp:textbox id="username" runat="server" size="18">


Password: <asp:textbox id="password" runat="server" size="18">

























-------------------------------------------------------------------
checklogin.aspx
--------------------------------------------------------------------
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>


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
}



}





--------------------------------------------------------------------------------------

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.

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 
GeneralPop up a child page at the specified location of parent page. Pin
George Ma19-Sep-02 17:43
George Ma19-Sep-02 17:43 
GeneralRe: Pop up a child page at the specified location of parent page. Pin
MHeckman22-Sep-02 12:45
MHeckman22-Sep-02 12:45 
GeneralRe: Pop up a child page at the specified location of parent page. Pin
George Ma27-Sep-02 4:12
George Ma27-Sep-02 4:12 
QuestionWhat is the difference between JDK and JRE? Pin
George Ma19-Sep-02 4:01
George Ma19-Sep-02 4:01 

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.