Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 28058

Classic AsP - Writing a checkbox value to an Access Database

$
0
0

Hi there - can anyone help - Ithis form is supposed to enter the value of the checkbox into the database but does not.  I have the database field: register set as yes/no.  But the form does not work with when I include the lines concerning "register".

The form itself is one that everyone meets when registering on a new forum.  They have to tick the checkbox to register.  I can't get the value of the checkbox to register in the database and so everytime the form is submitted, it returns a message to say, no - the checkbox has not been crossed!  Which is untrue.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%@LANGUAGE="VBSCRIPT"%>
<head>
<title>xxx</title></head>
<body bgcolor="#EEEEEE" TEXT="#000000">


<table align="center" cellSpacing="5" cellPadding="10" width="900">
<tr><td align=center>
<font size=7 color="#B08D00" face="Georgia"><b>login or register on our forum</font></td></tr>

<tr><td align="right" valign="bottom">
<b>
<font face= "Georgia" size=5 color="#000000">&quot;To login to our Forum&quot;</font></b><br><br>
</td>
</tr></table>


<hr width=900 size=0 color=#000000 align=center>
<%
' On Error Resume Next

If Request.Form("wname") = "" Then

' This part of the script enables a person
' to enter data in an HTML form.
%>

<div align=center>

&nbsp;<table border="0" valign="top" width="890" cellspacing=5 cellpadding=5 align="center">
<tr><td align=left>


<form METHOD="Post" ACTION="reg2.asp">


<table align="center" cellSpacing="5" cellPadding="10" width="900">
<font face= "Arial" size="2"><font face="Arial" size="2">

<tr>
<td><font face= "Arial" size="2">New Username:</font>
</td>
<td><font size="-1" color="#00009F">Newbie</font>
</td>
<td><font face= "Arial" size="2"><input NAME="frmNewusername" TYPE="TEXT" SIZE="15"></font>

</td>
</tr>
<tr>
<td><font face= "Arial" size="2">New Password:</font>

</td>
<td><font size="-1" color="#00009F">HiXXXXXX</font>
</td>
<td><font face= "Arial" size="2"><input NAME="frmNewpassword" TYPE="TEXT" SIZE="40"></font>

</td>
</tr>
<tr>
<td><font face= "Arial" size="2">New E-Mail:</font>

</td>
<td><font size="-1" color="#00009F">newbie@orange.fr</font>
</td>
<td><font face= "Arial" size="2"><input NAME="frmEmail" TYPE="TEXT" SIZE="40"></font>

</td>
</tr><tr>


<tr>
If you are a new user, please register by completing the following form: but
confirm first that you agree to the conditions of the forum
</font>

<label for="register">I agree to the terms of the forum</label>
<label for="register"><input type="checkbox" name="register" id="register" value="1" checked="checked">
Yes</label>

<td><input TYPE="HIDDEN" NAME="wname" VALUE="wvalue"></td>

<td><input NAME="OK" TYPE="SUBMIT" Value = REGISTER>
</td>
</tr>
</table>
</form>

<hr>


<%end if%>

</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> xxx </title>

</head>
<body bgcolor="#EEEEEE" TEXT="#000000">

<% If Request.Form("FrmNewusername") = "" Then %> <p><font face= "Arial" size="2">
You have not entered your First Name.</font>

You can try it <font face="Arial" background-color "#00FFFF">[&nbsp;<a href onclick="window.history.back()">RETURN</span></a>&nbsp;]</font>
again

<% ElseIf Request.Form("frmregister") = "" Then %><font face= "Arial" size="2">
Thank you but you did not agree to terms</font>

You can try it <font face="Arial" background-color "#00FFFF">[&nbsp;<a href onclick="window.history.back()">RETURN</span></a>&nbsp;]</font>
again


<% ElseIf Request.Form("frmEmail") = "" Then %><font face= "Arial" size="2">
Thank you but there is no lastname entered</font>

You can try it <font face="Arial" background-color "#00FFFF">[&nbsp;<a href onclick="window.history.back()">RETURN</span></a>&nbsp;]</font>
again


<% ElseIf Request.Form("frmNewpassword") = "" Then %><font face= "Arial" size="2">
Thank you but there is no email entered</font>

You can try it <font face="Arial" background-color "#00FFFF">[&nbsp;<a href onclick="window.history.back()">RETURN</span></a>&nbsp;]</font>
again


<% ElseIf Request.Form("frmNewusername") = "" Then %><font face= "Arial" size="2">
You forgot to enter your username <span lang="en-gb"></span>.</font>

<font face= "Arial" size="2">You can try it <font face="Arial" background-color "#00FFFF">
[&nbsp;<a href onclick="window.history.back()">RETURN</span></a>&nbsp;]</font> again


<% Else %>

</table>

<hr>


<%
vregister = Request.Form("frmRegister")
vregister = Replace(vregister, "'", "''")
vnewusername = Request.Form("frmNewusername")
vnewusername = Replace(vnewusername, "'", "''")
vnewpassword = Request.Form("frmNewpassword")
vnewpassword = Replace(vnewpassword, "'", "''")
vregister = Request.Form("frmregister")
vregister = Replace(vregister, "'", "''")
vemail = Request.Form("frmEmail")
vemail = Replace(vemail, "'", "''")

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "nnfrance"
abf = "INSERT INTO [registration] ( register, newusername, email, newpassword ) VALUES " & "('" & Request.Form("frmNewusername") & "','"
abf = abf & Request.Form("frmEmail") & "', '"
abf = abf & Server.HTMLEncode (vregister) & "', '"
abf = abf & Server.HTMLEncode (vnewpassword) & ")"
Set RS = Conn.Execute(abf)

%>


<CENTER>
<br><br><br>
<center><TABLE border=2 cellPadding=18 cellSpacing=0 width=570>
<TBODY>

<p><b><font><h2><font color="#FF0000">Thank YOU <br> <%= Request.Form("frmNewusername") %></font>

<font face="Arial"></h2>
<h3>CONFIRMATION OF RECEIPT</h3>
</font></b><br>Thank you for your valuable contribution which is greatly
appreciated.<b><font ="arial" size="2"><bt> </b>
<br>

<p><font><i>Here is what you have sent us: </p></i></font>

<hr>
<font face= "Arial" size="2">
First Name:
<% vnewusername = Request.Form("frmNewusername") %>
<% vnewusername = Replace(vnewusername, VbCrLf, "<BR>") %>
<font color="#00009F"><%= vnewusername %> </font>

<br> Last Name:
<% vnewpassword = Request.Form("frmNewpassword") %>
<% vnewpassword = Replace(vnewpassword, VbCrLf, "<BR>") %>
<font color="#00009F"><%= vnewpassword %> </font>
<br> YES:
<% vregister = Request.Form("frmregister") %>
<% vregister = Replace(vregister, VbCrLf, "<BR>") %>
<font color="#00009F"><%= vregister %> </font>

<br> Email:
<% vemail = Request.Form("frmEmail") %>
<% vemail = Replace(vemail, VbCrLf, "<BR>") %>
<font color="#00009F"><%= vemail %> </font>

Please click here to return to
<a href="http://www.xxx.com">ccc</a>

</table>
<br>


<% End If %>

</html>
</body>

Please help - my email address is: tracy_wi@hotmail.com 

 


Viewing all articles
Browse latest Browse all 28058

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>