Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics 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 February 16th, 2007, 05:36 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

cool, when and where will it show up and what sort of thing will i be looking for?

neil

 
Old February 16th, 2007, 05:43 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

...

   sql = "SELECT * FROM tblusers WHERE UCase(username)=' "& UCase(username) & "' AND UCase(password)=' " & UCase(password) & " ' "
response.write(sql)

this will write the value of Sql out to the very top of the screen (will all of the values evaluated) so it might be SELECT * from tblUsers where username = 'Admin' and Password = 'password'

Also you may want to look into this book.
http://www.wrox.com/WileyCDA/WroxTit...764543636.html



================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 16th, 2007, 05:46 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

thanks, i really appreciate all of this.

i will do it asap and tell you the output - my home pc hasnt got IIS installed so i am looking for my XP disk.

Neil

 
Old February 19th, 2007, 05:18 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

good morning all.....

i tested the website 5 mins ago with no changes after it loaded last friday and today it just shows the code on the page - could this be because i rolled back from IE 7 to IE 6?

Neil

 
Old February 19th, 2007, 11:35 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Your browser has nothing to do with it. If you are seeing your code in the browser window, IIS is not setup properly. (The directory the file is being served from is probably not set up as an application would be my guess.)

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 19th, 2007, 11:45 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

hi,

how would i change that then?

my main issue is it worked fine last friday, i shut the pc down, booted it up today and it now comes up with code!

Neil

 
Old February 19th, 2007, 11:50 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Are you navigating to the url e.g. http://localhost or are you going directly to the file in your address bar e.g. file://C:\inetpub\wwwroot\login.asp

If you are doing the latter of the 2, that is why it would only display text, because you aren't executing the code at that point, just opening the file.

To make sure a directory is running as an application, open the IIS MMC expand the computer node, then expand the website node, you will see a directory listing, right click on the folder you are serving your asp page from and select properties. A window will open and on that intial screen you will see application settings towards the bottom, if the button labeled "Create" is enabled, click it, hit apply, ok and try browsing to the page again.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429
 
Old February 19th, 2007, 01:34 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

Hi dparsons,

thanks again, it works now, will put the updated coding in when i get home and then i will tell you if it lets me login or not.

Neil

 
Old February 19th, 2007, 05:45 PM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 115
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to neil.abachi07
Default

hey

i changed the response.write and it errored on me with an http 500.100 message
i changed the code below the response.write and i dont get an invalid password message until i try to login and then the same issues - invalid regardless of a corect entry or not.

any ideas?

neil

 
Old February 19th, 2007, 05:52 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Copy and paste this code, change the string to the database, it should work without error.

<%
dim username, password
username=TRIM(Request("username"))
password=TRIM(Request("password"))

If username <> "" AND password <> "" then
Dim Con, sql, rec
set Con = Server.CreateObject("ADODB.Connection")
Con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database.mdb")
'Select the record matching the username.
sql = "SELECT * FROM tblusers WHERE username='"& UCase(username) & "' AND password='" & UCase(password) & "'"
set rec=Con.execute(sql)
'If no match found, EOF is not true.
if NOT rec.EOF then
     Response.Redirect("somepage.asp") 'Change to page redirect to after login
else
     blankError="Invalid username." 'EOF is true, no match found.
end if
else
%>

<html>
    <head>
        <title>Login</title>
    </head>
    <body>
        <form name="productForm" method="post" ID="Form1">
            <center>
                <table border="1" ID="Table1">
                    <tr>
                        <td colspan="2">
                            <%

if blankError<>"" then
Response.Write("<center>"&blankError&"</center>")
end if
%>
                        </td>
                    </tr>
                    <tr>
                        <td><Strong>Username:</Strong></td>
                        <td><input type="text" name="username" size="35" ID="Text1"></td>
                    </tr>
                    <tr>
                        <td><Strong>Password</Strong></td>
                        <td><input type="password" name="password" size="35" ID="Password1"></td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center"><input type="submit" name="loginButton" value="Login" ID="Submit1">
                            <input type="reset" name="reset" value="Clear" ID="Reset1"></td>
                    </tr>
                </table>
            </center>
        </form>
    </body>
</html>
<%end if%>

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html

Discussion:
http://p2p.wrox.com/topic.asp?TOPIC_ID=56429





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic page creation DyerOppenheimer BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 June 29th, 2009 05:34 PM
delayed login account creation GameGorilla BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 January 22nd, 2008 11:27 PM
Creation of HTML page by C# Somesh C# 1 January 24th, 2007 03:21 PM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 07:47 AM
username/password creation of login page in asp undercurrent Classic ASP Basics 3 March 21st, 2005 08:38 PM





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