Jump to content

Belzar

Members
  • Posts

    37
  • Joined

  • Last visited

Belzar's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Could I include a file on each of my pages to make it easier then putting them on everyone of my web pages... what i am trying to do is add a thing of buttons to the top of each page, and these are the buttons http://droppingthebomb.com/buttons.htmhere is my problem... I just want to be able to use this in each of my pages: <!--#include file="buttons.htm"--> I basically want to use it in a table right above the rest of the page, i am not able to do that though, is there something else i can do to where i wont have to manually add these buttons to each of my pages?
  2. Hehe, never mind, it was just a database error, thanks for all the help, couldnt have done it without you
  3. Thanks again for the help on that last problem, it got me past it and i just ran into another one... this is the code I am using again with signup1.asp <% Option ExplicitFunction SQLSecurity(myStr) 'This eliminates the risk of SQL injection SQLSecurity = Replace(myStr, "'", "''", 1, -1, vbBinaryCompare)End FunctionDim Username, PasswordUsername = cstr(request("username")) 'the cstr function explicitly casts thePassword = cstr(request("Password")) 'variable as a string.'Validating username and password.If Username = "" then response.redirect "signup.asp?msg=Invalid username."elseif Password = "" then response.redirect "signup.asp?msg=Invalid password.&username=" & username'elseif Len(username) < 3 then 'this checks to see that the username at least 3' 'characters long' response.redirect "signup.asp?msg=Username must be at least" & _' "3 characters long.&username=" & username'elseif Len(password) < 3 then 'this checks to see that the password at least 3' 'characters long' response.redirect "signup.asp?msg=Password must be at least" & _' "3 characters long.&username=" & usernameEnd ifelseif Len(username) > 25 then response.redirect "signup.asp?msg=Username cannot be longer than" & _ "25 characters.&username=" & usernameelseif Len(password) > 25 then response.redirect "signup.asp?msg=Password cannot be longer than" & _ "25 characters.&username=" & usernameEnd if'I've commented out the minimum username and password validations. Just'remove the apostrophes before the appropriate lines if you want to use those'validations.Dim Conn, RS, SQL, SuccessfulSet Conn = Server.CreateObject("ADODB.Connection")Set RS = Server.CreateObject("ADODB.RecordSet")SQL = "Select Username, Password, IPAddress, Email, DateRegistered FROM Users WHERE " & _ "Username = '" & SQLSecurity(Username) & "' Limit 1;"Conn.Open my_connection_stringRS.Open SQL, Conn, 3, 3 If RS.EOF then 'RS.EOF means no results returned from the SQL query. In this case, since 'no results were returned the query executed above, then it means there 'is no user in the Users table with the same username. So, we can insert the 'new username. 'Adding new account to the Users table RS.AddNew RS("Username") = Username RS("Password") = Password RS("IPAddress") = Request.ServerVariables("REMOTE_ADDR") RS("DateRegistered") = Now RS.Update 'Setting cookies for the user. These cookies will expire in 1 year. Response.Cookies("account")("username") = Username Response.Cookies("account")("password") = Password Response.Cookies("account").Expires = DateAdd("m", 12, Now()) Successful = True else 'If a result is found for the query above, that means a user already exists 'with the chosen username, so we have to forward the user back to the 'signup page and ask him or her to choose another name. Successful = False End ifRS.CloseConn.CloseSet Conn = nothingSet RS = nothingIf Successful = True then%> <html> <body> <h1>Congrats!</h1> <p>Your account has been successfully created, <%=Request.Cookies("account")("username")%> </p> <p>Please go back to the <a href="default.asp">home page</a>, or for free to edit your <a href="profile.asp">profile</a>.</p> </body> </html><%else response.redirect "signup.asp?msg=Username is already taken." & _ "&username=" & usernameEnd if%> And here is the error its giving me in the browser:Microsoft OLE DB Provider for ODBC Drivers error '80040e21'ODBC driver does not support the requested properties./signup1.asp, line 47 I have tried to see whats wrong with this line, but i cant figure out why.... maybe it doesnt want to let RS.Open i dont know, much appreciated if i could get more help
  4. Hey Yahweh, sorry was just a typo, thanks i thought i it might have to do with it... i appreciate it
  5. Hi, i at one time was trying to make an asp signup page... I went through this for a long time, and finally got it working last time, but now i dont remember how i did it...I got this code from yewhaw or something like that on here, and i did get it to work after some time,Here is the signup.asp page: <% Option Explicit %><html><body><h1>Signup</h1><% Dim msgmsg = request("msg")if cstr(msg) <> "" then%><font color="red"><%=Server.HTMLEncode(msg)%></font> <%end if%><br> <form action="signup1.asp" method="post"> <p><font color="#FF0000">Username:</font><br> <input type="text" name="username" value=<%=Server.HTMLEncode(request("Username"))%>> </p> <p><font color="#FF0000">Password:</font><br> <input type="password" name="password"> <br> <input type="submit" value="Register"> <br> <small>(Cookie must be enabled to complete registration.)</small> </p></form></body></html> After it goes to signup1.asp, it gives me some error that says:ADODB.Recordset error '800a0e7d'The connection cannot be used to perform this operation. It is either closed or invalid in this context./signup1.asp, line 46 <% Option ExplicitFunction SQLSecurity(myStr) 'This eliminates the risk of SQL injection SQLSecurity = Replace(myStr, "'", "''", 1, -1, vbBinaryCompare)End FunctionDim Username, PasswordUsername = cstr(request("username")) 'the cstr function explicitly casts thePassword = cstr(request("Password")) 'variable as a string.'Validating username and password.If Username = "" then response.redirect "signup.asp?msg=Invalid username."elseif Password = "" then response.redirect "signup.asp?msg=Invalid password.&username=" & username'elseif Len(username) < 3 then 'this checks to see that the username at least 3' 'characters long' response.redirect "signup.asp?msg=Username must be at least" & _' "3 characters long.&username=" & username'elseif Len(password) < 3 then 'this checks to see that the password at least 3' 'characters long' response.redirect "signup.asp?msg=Password must be at least" & _' "3 characters long.&username=" & usernameEnd ifelseif Len(username) > 25 then response.redirect "signup.asp?msg=Username cannot be longer than" & _ "25 characters.&username=" & usernameelseif Len(password) > 25 then response.redirect "signup.asp?msg=Password cannot be longer than" & _ "25 characters.&username=" & usernameEnd if'I've commented out the minimum username and password validations. Just'remove the apostrophes before the appropriate lines if you want to use those'validations.Dim Conn, RS, SQL, SuccessfulSet Conn = Server.CreateObject("ADODB.Connection")Set Conn = Server.CreateObject("ADODB.RecordSet")SQL = "Select Username, Password, IPAddress, Email, DateRegistered FROM Users WHERE " & _ "Username = '" & SQLSecurity(Username) & "' Limit 1;Conn.Open my_connection_stringRS.Open SQL, Conn, 3, 3 If RS.EOF then 'RS.EOF means no results returned from the SQL query. In this case, since 'no results were returned the query executed above, then it means there 'is no user in the Users table with the same username. So, we can insert the 'new username. 'Adding new account to the Users table RS.AddNew RS("Username") = Username RS("Password") = Password RS("IPAddress") = Request.ServerVariables("REMOTE_ADDR") RS("DateRegistered") = Now RS.Update 'Setting cookies for the user. These cookies will expire in 1 year. Response.Cookies("account")("username") = Username Response.Cookies("account")("password") = Password Response.Cookies("account").Expires = DateAdd("m", 12, Now()) Successful = True else 'If a result is found for the query above, that means a user already exists 'with the chosen username, so we have to forward the user back to the 'signup page and ask him or her to choose another name. Successful = False End ifRS.CloseConn.CloseSet Conn = nothingSet RS = nothingIf Successful = True then%> <html> <body> <h1>Congrats!</h1> <p>Your account has been successfully created, <%=Request.Cookies("account")("username")%> </p> <p>Please go back to the <a href="default.asp">home page</a>, or for free to edit your <a href="profile.asp">profile</a>.</p> </body> </html><%else response.redirect "signup.asp?msg=Username is already taken." & _ "&username=" & usernameEnd if%> The link to this is as follows:http://droppingthebomb.com/signup.asp
  6. Great it does work, it just doesnt look like it does inside dreamweaver... thanks for all the help
  7. What I am trying to do is make it so you can copy the code from my page and put it on myspace comments... I hate to show this, cuz its a lil vulgar or bad, but the thing i want to be able to use this for is at http://droppingthebomb.com/ecards/######/pony2.htm when i put the code inside the box, it looked like it was just showing it as it would on the web page, but i didnt upload it to try cuz i didnt think it would work... it looked something like this:<textarea><font color='FF0066' size='7'>Don't mind me,<br><a href='http://droppingthebomb.com'><embed img src='http://droppingthebomb.com/gfx/tampon.jpg'></a><br>I'm riding the cotton pony.</font></textarea>
  8. Hi everyone, I am trying to make a <textarea> with code inside of it on my website, like they have here, and I know I have seen it on other sites. When I do it on my site, it always just runs the code, it will not let me just have the code so I can show what certain codes are... Can anyone help me please?
  9. I remember a long while back, i always saw some one mention a space where you could get a free website from an asp host... can someone tell me where to go for that please
  10. hi, this seems to be the same question i asked and was replied with an answer that worked great by Yahweh i think it was... this is the code and it works perfectly, also can see it under my post on this page last i looked called Password protecting pages... this is actually just copied from there <%Dim strPasswordstrPassword = request("password")if Password = "baby" then%> The rest of your page contents should go here.<%else%> <form action="<%=Request.ServerVariables("SCRIPT_NAME")%>" method="post"> What's the password:<br> <input type="password" name="password"> <p> <input type="Submit" value="Go!"> </p> </form><%end if%> You can make the password whatever you want to with line number 5
  11. Hey, I guess what I mean is a Visual Studio type program... I used Dreamweaver on Windows so I could do the graphics and all... Now, besides the text editor I am not sure what to use to do this.
  12. Hi, before when I was writing asp I was using Windows Operating System, I recently swiched back to Linux OS and I am having trouble writing asp using it. I am using the program called Nvu and it seems to only make HTML files. If there is anybody here that uses Linux and knows a good program that will help me, please reply and let me know. Thanks a lot.
  13. Nevermind, I finally got it working.. thanks for all the help
  14. Hey again, I am still having trouble with this code. It is like I get it so close to working then I run into another problem. Atleast now I am using a browser that lets me see where the error is, before it wouldnt tell me. I copied the code just to try to make it work and it is telling me that the ODBC Driver does not support this action. Here is the code. <% Option ExplicitFunction SQLSecurity(myStr) 'This eliminates the risk of SQL injection SQLSecurity = Replace(myStr, "'", "''", 1, -1, vbBinaryCompare)End FunctionDim Username, PasswordUsername = cstr(request("username")) 'the cstr function explicitly casts thePassword = cstr(request("Password")) 'variable as a string.'Validating username and password.If Username = "" then response.redirect "signup.asp?msg=Invalid username."elseif Password = "" then response.redirect "signup.asp?msg=Invalid password.&username=" & username'elseif Len(username) < 3 then 'this checks to see that the username at least 3' 'characters long' response.redirect "signup.asp?msg=Username must be at least" & _' "3 characters long.&username=" & username'elseif Len(password) < 3 then 'this checks to see that the password at least 3' 'characters long' response.redirect "signup.asp?msg=Password must be at least" & _' "3 characters long.&username=" & usernameEnd ifelseif Len(username) > 25 then response.redirect "signup.asp?msg=Username cannot be longer than" & _ "25 characters.&username=" & usernameelseif Len(password) > 25 then response.redirect "signup.asp?msg=Password cannot be longer than" & _ "25 characters.&username=" & usernameEnd if'I've commented out the minimum username and password validations. Just'remove the apostrophes before the appropriate lines if you want to use those'validations.Dim Conn, RS, SQL, Successful, DSNNameDSNName = "PROVIDER=MSDASQL;driver={MySQL ODBC 3.51 Driver};server=mysql14.ixwebhosting.com;option=18475"Set Conn = Server.CreateObject("ADODB.Connection")Set RS = Server.CreateObject("ADODB.RecordSet")Conn.Open DSNNameSQL = "Select Username, Password, IPAddress, Email, DateRegistered FROM Users WHERE " & _ "Username = '" & SQLSecurity(Username) & "' Limit 1;"RS.Open SQL, Conn, 3, 3 'This is line number 48, where the error is occuring If RS.EOF then 'RS.EOF means no results returned from the SQL query. In this case, since 'no results were returned the query executed above, then it means there 'is no user in the Users table with the same username. So, we can insert the 'new username. 'Adding new account to the Users table RS.AddNew RS("Username") = Username RS("Password") = Password RS("IPAddress") = Request.ServerVariables("REMOTE_ADDR") RS("DateRegistered") = Now RS.Update 'Setting cookies for the user. These cookies will expire in 1 year. Response.Cookies("account")("username") = Username Response.Cookies("account")("password") = Password Response.Cookies("account").Expires = DateAdd("m", 12, Now()) Successful = True else 'If a result is found for the query above, that means a user already exists 'with the chosen username, so we have to forward the user back to the 'signup page and ask him or her to choose another name. Successful = False End ifRS.CloseConn.CloseSet Conn = nothingSet RS = nothingIf Successful = True then%> <html> <body> <h1>Congrats!</h1> <p>Your account has been successfully created, <%=Request.Cookies("account")("username")%> :)</p> <p>Please go back to the <a href="default.asp">home page</a>, or for free to edit your <a href="profile.asp">profile</a>.</p> </body> </html><%else response.redirect "signup.asp?msg=Username is already taken." & _ "&username=" & usernameEnd if%> I, of course took out the user, password and database name... but, this is the error it is giving me. I do not know why it is not working, please help me again Thanks.
  15. Belzar

    The signup.asp pages

    I would, it is just that I dont get an error strangely enough. ill check out line 27, thanks.
×
×
  • Create New...