PDA

View Full Version : problem with my registration form


stewmath
10-20-2005, 11:39 PM
Goto http://82.33.4.2 and try and register. It comes up with an error on line 12. Could you please help me. If you would like a copy of the register.asp code to help please email me at stewmath@gmail.com for access to the ftp

Brandoe85
10-20-2005, 11:41 PM
Yes, can you just post your asp code here for us to take a look at?

stewmath
10-20-2005, 11:44 PM
<!-- #include file="common.asp" -->
<%
'Page created by Stewart Mathers
openDB()

' If a logged in customer comes here, may as well redirect them as they don't need to be here
if Session("CustomerID") <> "" then
Response.Redirect("default.asp")
end if
if Request.Form("op") = "register" then
Set objConn = Server.CreateObject("ADODB.Connection")
objRS.open "INSERT INTO Customers(Customer_UserName, Customer_Password, Customer_Name, Customer_Email, Customer_Address_Line1, Customer_Address_Line2, Customer_Address_Line3, Customer_Address_Line4, Customer_Address_Line5, Customer_Address_Line6, Customer_Telephone, Customer_Fax) VALUES ('" & SQL_safe(Request.Form("username")) & "','" & SQL_safe(Request.Form("user_password")) & "','" & SQL_safe(Request.Form("realname")) & "', '" & SQL_safe(Request.Form("email")) & "', '" & SQL_safe(Request.Form("billing_house")) & "', '" & SQL_safe(Request.Form("billing_street")) & "', '" & SQL_safe(Request.Form("billing_area")) & "', '" & SQL_safe(Request.Form("billing_town")) & "', '" & SQL_safe(Request.Form("billing_county")) & "', '" & SQL_safe(Request.Form("billing_postcode")) & "', '" & SQL_safe(Request.Form("telephone")) & "', '" & SQL_safe(Request.Form("fax")) & "')", objConn

' We could now send an email to the users new address
' Code included to show how it would be done, but commented it so not to produce errors if the email system isn't set up on the test server

'Set Mail = Server.CreateObject("CDONTS.NewMail")

'Mail.To = Request.Form("email")
'Mail.From = "profiles@echoelectronics.com"
'Mail.Subject = "Account creation"
'Mail.Body = "Hello " & Request.Form("realname") & "," & vbCrLf & vbCrLf & " We would like to welcome you to Echo Electronics. We hope that we are able to provide you with all your electronic needs" & vbCrLf & vbCrLf & "Echo Electronics"
'Mail.Send

'Set Mail = nothing

%>
<div class="pageSectionHead">Registration complete</div>
<div class="pageSection"><div class="nav" style="text-align: left;">Thank you for registering to use the Echo Electronics online shopping system<br /><br />Your registration is complete you may now place orders</div></div>
<%
else

%>

<div class="pageSectionHead">Register</div>
<form name="details" method="post" action="default.asp" onsubmit="return check_register_details();">
<input type="hidden" name="p" value="reg" />
<input type="hidden" name="op" value="register" />
<table border="0" cellpadding="6" cellspacing="0" class="tableGeneric">
<tr>
<td colspan="2"><p class="tableSection">Login details</p></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Username: <span class="required">*</span></th>
<td><input name="username" type="text" size="20" maxlength="20" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Password: <span class="required">*</span></th>
<td><input name="user_password" type="password" size="20" maxlength="20" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Confirm password: <span class="required">*</span></th>
<td><input name="user_password2" type="password" size="20" maxlength="20" /></td>
</tr>
<tr>
<td width="25%" nowrap="nowrap"><a href="javascript:generate_password()">Generate a random password</a></td>
<td><input type="text" name="random" value="" class="randomPassword" readonly="readonly" tabindex="25" /></td>
</tr>
</table>
<table border="0" cellpadding="6" cellspacing="0" class="tableGeneric">
<tr>
<td colspan="2"><p class="tableSection">Contact details</p></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Real name: <span class="required">*</span></th>
<td><input name="realname" type="text" size="50" maxlength="50" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">E-Mail address: <span class="required">*</span></th>
<td><input name="email" type="text" size="50" maxlength="50" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Phone number:</th>
<td><input name="telephone" type="text" size="20" maxlength="20" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Fax number:</th>
<td><input name="fax" type="text" size="20" maxlength="20" /></td>
</tr>
</table>
<table border="0" cellpadding="6" cellspacing="0" class="tableGeneric">
<tr>
<td colspan="2"><p class="tableSection">Billing details</p></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">House name/number: <span class="required">*</span></th>
<td><input name="billing_house" type="text" size="60" maxlength="60" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Street name: <span class="required">*</span></th>
<td><input name="billing_street" type="text" size="50" maxlength="50" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Area name:</th>
<td><input name="billing_area" type="text" size="50" maxlength="50" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">City/Town: <span class="required">*</span></th>
<td><input name="billing_town" type="text" size="50" maxlength="50" /></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">County: <span class="required">*</span></th>
<td><%=Response.Write(generate_county_list("billing_county", 0, 0))%></td>
</tr>
<tr>
<th width="25%" nowrap="nowrap">Postcode: <span class="required">*</span></th>
<td><input name="billing_postcode" type="text" size="10" maxlength="8" /></td>
</tr>
</table>
<table border="0" cellpadding="6" cellspacing="0" class="tableGeneric">
<tr>
<td colspan="2" style="text-align: center;"><input type="submit" value="Register" /></td>
</tr>
</table>
</form>
<span class="required">*</span> Denotes a required field

<%
end if

closeDB()
%>

stewmath
10-20-2005, 11:54 PM
i know that its something to do with line 12. its having trouble opening the database and writing the registration info to it