hi all,
I'm designing my website and I create a form page and connected with asp code :this is the code
=======

<%
USER NAME= trim(request.form("USER NAME"))
E-MAIL= trim(request.form("E-MAIL"))
PASSWORD= trim(request.form("PASSWORD"))
CONFIRM PASSWORD= trim(request.form("CONFIRM PASSWORD"))
FIRST NAME= trim(Request.Form("FIRST NAME"))
LAST NAME= trim(Request.Form("LAST NAME"))
SEX= trim(request.form("SEX"))
DATE OF BIRTH= trim(request.form("DATE OF BIRTH"))
PO BOX= trim(request.form("PO BOX"))
PC= trim(request.form("PC"))                                                
mysql="Insert into pro(USER NAME,E-MAIL,PASSWORD,CONFIRM PASSWORD,FIRST NAME,LAST NAME,SEX,DATE OF BIRTH,PO Box,PC,) values('"&USER NAME&"','"&E-MAIL&"','"&PASSWORD&"','"&CONFIRM PASSWORD&"','"&FIRST NAME&"','"&LAST NAME&"','"&SEX&"','"&DATE OF BIRTH&"','"&PO BOX&"','"&PC&"')"
Set con=Server.CreateObject("ADODB.Connection")
con.Open "DSN=project2"
con.Execute mysql
response.write "you are now a member"
%>

but it shows error when I press the button submit
this is the error
===

Expected end of statement
/joooj/jonline/regis2.asp, line 9, column 8
DATE OF BIRTH= trim(request.form("DATE OF BIRTH"))
-------^


please help me ..
thank you

Recommended Answers

All 4 Replies

Spaces are not supposed to be allowed i n variable names. I am surprised there wasn't an error in a previous line. Since Date is a reserved word it seems to be getting getting confused and thinks OF is a date or something. Take out all spaces in variable names and the problem should go away. Underscore is a good substitute - use DATE_OF_BIRTH and see what happens.

ok and thank you

I tried another asp codes
===========
<% Response.Buffer = True %>

<html>
<head>
<title>joooj online</title>
</head>
<body>

<%
Dim rs
Set rs = Server.CreateObject ("ADODB.Recordset")

rs.Open "form1", "DSN=project"

While Not rs.EOF
Response.Write "USER_NAME : " & rs("USER_NAME") & "<br>"
Response.Write "PASSWORD: " & rs("PASSWORD") & "<br>"
Response.Write "CONFIRM_PASSWORD : " & rs("CONFIRM_PASSWORD") & "<br>"
Response.Write "FIRST_NAME : " & rs("FIRST_NAME") & "<br>"
Response.Write "LAST_NAME : " & rs("LAST_NAME") & "<br>"
Response.Write "SEX : " & rs("SEX") & "<br>"
Response.Write "DATE_OF_BIRTH : " & rs("DATE_OF_BIRTH") & "<br>"
Response.Write "PO_BOX : " & rs("PO_BOX") & "<br>"
Response.Write "PC : " & rs("PC") & "<br>"
Response.Write "<br>"

rs.MoveNext
Wend

rs.Close
Set rs = Nothing
%>

</body>
</html>

====
this time the error is
Unspecified error
?

Unspecified error
/joooj/jonline/r.asp, line 13

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.