ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old August 17th, 2003, 02:45 AM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Unhappy Login Password

hI ...

I am newbie to ASP ... i am trying to write a code to accept login and passwor from a user and verify through a table created in MySQL.

I am just trying to write a code on my own seeking help from code here and there and from my understanding. I am completely zapped :-(((

here is my code:-

DIM SQL
DIM RSA
DIM QUERY1

ConnString = "Driver={MySQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=test; "

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString

<FORM ACTION="login.asp" METHOD="post">
<TABLE BORDER=0>
<TR>
<TD ALIGN="right">LOGIN:</TD>
<TD><INPUT TYPE="text" NAME="txtID"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right">PASSWORD:</TD>
<TD><INPUT TYPE="password" NAME="txtPASSWORD"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit" VALUE="Login"></INPUT>
<INPUT TYPE="reset" VALUE="Reset"></INPUT>
</TD>
</TR>
</TABLE>
</FORM>

QUERY1 = "SELECT stUDENT_ID,STUDENT_PASSWORD from STUDENT_INFO"
SET RSA = = Server.CreateObject("ADODB.Recordset")
Set RSA = conn.Execute(QUERY1,,adCmdText)

if RSA.EOF then
response.Write("NO MATCH")
else
if ([QUERY1.STUDENT_ID] = [txtID]) AND ([QUERY1.STUDENT_PASSWORD] = [txtPASSWORD]) then

response.write "<p>" & "<center>" & "U CAN " & "</center>" & "</p>"

else
response.write "No ID FOUND"

end if

Set rs = Nothing
Set conn = Nothing
%>


I know my code is not at all written nicely! Can anyone help me with a sample code for user-id verification? I want to know how to write a code using ASP (MYSQL). I dont even know where to put the % sign and whether html comes before select query...i am all so frustrated and confused !

any sample code help would vbe highly appreciated!

thanks!!!

Reply With Quote
  #2  
Old August 17th, 2003, 10:25 AM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
generally the first login page is html, the textbox and password entry and all that jazz, you submit to login.asp on your page, if it's a different page, then fine, if it's the same page as your own, then at the top of your page you'll need to query the DB for all the info. You at least have an idea for what you need to do what is good.

you're confused on <% %> tags it looks like. These cause whatever is inbetween these tags to be run at the server when it spits back html to the user. So at the top of the page you have to
<%
dim conn,strSQL,RS
set conn ...
conn.open ("connection string")
then query and return the record set where user name and password = request.form("password") and login = request.form("password").
if RSA.eof then
display a incorrect login div tag here
else
response.redirect ("index.html")
end if

%>

Before doing anyqueries from asp, always open up mysql first and just hard code values in first. So open up mysql and check to make sure that your query string works, because it will differ on how you set up the password column....

tutorial

Reply With Quote
  #3  
Old August 17th, 2003, 09:58 PM
aspuser25 aspuser25 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 141 aspuser25 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
hey thanks..u r rite..
i was confused where to put what...

i will now work out..
thanks tremendously!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Login Password


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway