Jump to content

robokopf

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by robokopf

  1. hi jesh thanks for the reply. i've got it fixed and it's working now. here's my code. so sorry for the trouble <!--#INCLUDE VIRTUAL="Project/includes/connection.asp"--><%[b]dim usernameusername = request.querystring("user")[/b]strsql = "SELECT * FROM userdb WHERE username = '"&username&"'"
  2. hi guys, i'm trying to create a simple login system that retrieves the log-in information from a database. when a user logs in it'll create a session and the user will be redirected to the main page. and when the user clicks on his own username it'll redirect the user to a profile editing page. here's some codes. <p><a href="editprofile.asp?user=<%=Session("username")%>">edit my profile</a></p> when user clicks on this link it'll link up to editprofile page that will display his information and user is able to edit the information fields. <!--#INCLUDE VIRTUAL="Project/includes/connection.asp"--><%strsql = "SELECT * FROM userdb where username"set objRs = Server.CreateObject("ADODB.Recordset")objRs.open strsql,objConn,1,2if not objRs.eof then%><body><form name="update" method="get" action="updatedata.asp"><table border=1><tr><td>User ID:</td><td><INPUT name=name readonly value=<%=objRs("username")%>></td></tr><tr><td>Address:</td><td><INPUT name=text value=<%=objRs("address")%>></td></tr><tr><td><INPUT type=submit value=Submit name=submit></td><td><INPUT type=reset value=Reset name=reset></td></tr></table></form><%end if%> this is the code in the editprofile.aspthe problem is when i'm in this page, the information that is loaded is not of my own username but other accounts. i've created multiple test accounts in the database but it still does not display the correct information corresponding to the username. is there something wrong with the SQL codes or what? thanks in advance.
  3. hi guys, i'm following a tutorial in a Javascript text book that requires me to build a simple Fahrenheit to Celsius converter with a rounded output value and validation. My script contains 2 separate function, validation and calculation and i'm having problems with them. The problem is when i click on the Submit button, without entering values on the fahrenheit text box, the script will pass it as 0 and the result will be displayed on a celsius textbox. and at the same time there's a validation pop-up displaying error message as well. but when i click okay it clears up both the text box. my question is that should i combine and validation and calculation function together using something like a If else statement? thanks in advance. <html><title> Fahrenheit to Celsius Converter</title><body><script language="Javascript">function Validation(){ if (document.cal.fahrenheit.value.length==0){ window.alert("Please enter in a value..."); document.cal.fahrenheit.value=""; document.cal.celsius.value=""; document.cal.fahrenheit.focus(); return false; } else if (isNaN(document.cal.fahrenheit.value)==true){ window.alert("Please enter in a valid value..."); document.cal.fahrenheit.value=""; document.cal.celsius.value=""; document.cal.fahrenheit.focus(); return false; } else return true;}function temp (form){ form.celsius.value = Math.round((form.fahrenheit.value-32)*5/9)}</script><h1>Fahrenheit to Celsius Converter</h1><table><form name=cal action="java script:void()" method=post onsubmit="return Validation();"><tr><td>Fahrenheit:</td><td><input type="text" name="fahrenheit"></td><tr><td><input type="submit" value="Convert it!" onClick="temp (this.form);"></td><td><input type="reset" value="Reset!"></td></tr></tr><tr><td>Celsius:</td><td><input type="text" name="celsius"></td></tr></form></table></body></html> here's a sample of my code. thanks in advance...
  4. hi scott100, thanks for the reply and the tip. works perfectly now. thanks a lot
  5. hi guys, i'm just starting on javascript and i've got a question about escape sequence and using them together with the document.write. here's a sample code that i have document.writeln('<font size=3 face=verdana>'+name+'</font>');document.writeln('<font size=3 face=verdana>'+age+'</font>'); i was wondering how to i add in the \n - new line escape sequence? thanks in advance
×
×
  • Create New...