0

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

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by joe111
0

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.

0

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
?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.