Form not passing session variables

Posted on 2008-10-17
Medium Priority
Last Modified: 2012-06-21
Hi, can someon take a look at my code , I am having error when trying to insert some values into my table in a SQL database
index.asp ( form page)
if (Request.Form("Submit")="") then
<!-- #include file="session_destroy.asp"-->
<%end if%>
<!--#include file="../include/intialize.inc"-->
<!--include file="../include/connection.asp"-->
<!--#include file="../../Connections/sqlConn1.asp" -->
<!-- Include file for CAPTCHA configuration -->
<!-- #include file="CAPTCHA/CAPTCHA_configuration.asp" -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- email field must contain a valid e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- zip code field must contain only numbers.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
function YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
    } else if (myObj.type=='checkbox'){
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
    }else if (myObj.type=='textarea'){
    if (addErr){myErr+='* '+args[i+3]+'\n'; addErr=false}
  if (myErr!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
<script language="JavaScript">
function isAlpha ( evt ) {
   var keyCode = evt.which ? evt.which : evt.keyCode;
   alpha = ( keyCode >= 'a'.charCodeAt ( ) &&
      keyCode <= 'z'.charCodeAt ( ) ) || 
      ( keyCode >= 'A'.charCodeAt ( ) &&
      keyCode <= 'Z'.charCodeAt ( ) ) || 
      ( keyCode >= 8 && keyCode <= 46 );
   return ( alpha );
function validateAlpha ( text ) {
   for ( c=0; c < text.length; c ++ ) {
      alpha = ( text.charCodeAt ( c ) >= 65 &&
         text.charCodeAt ( c ) <=90 ) || 
         ( text.charCodeAt ( c ) >= 97 &&
         text.charCodeAt ( c ) <=122 )
      if ( !alpha ) {
         alert ( 'No way, sorry.' );   
         document.theForm.theField.select ( );
         return false;
   return true;
' Member Registration 
	if 		(Request.Form("Submit")<>"") then
			session("S_securitycode")= request.form("securityCode")
' is catching only if double user id entered  is checking it but only if user id alrwady exists 
' in here 
txtemailid = Request.Form("txtemailid") ' this is where i get the email from the form 
sql7 = " Select Email from Players Where Email = '"&txtemailid&"'"
set rs7 = Server.Createobject("ADODB.Recordset")
set rs7=conSQL.execute(sql7)
if not rs7.EOF then %>
<script language='Javascript'>
	alert('The Enter E-Mail already exist on our database , please enter a different e-mail ....'); 
<% End If %>
		'toaddress = Request.Form("recipient")
  		'.To = "&toaddress&"
		set rs = Server.Createobject("ADODB.Recordset")
		sql = "select * from Players where SSN='"&txtuname&"'"
		rs.open sql,conSQL
		if rs.BOF then 
		set rs2 = Server.Createobject("ADODB.Recordset")
		sql1 = "select count(*) as memcon from Players where courseID="&txtcourseid&" and memberid='"&txtmemberid&"'"
		sql11 = "select count(*) as memcon from Players where courseID="&txtcourseid&" and Email='"&txtemailid&"'"
		set rs2=conSQL.execute(sql1)
		set rs2=conSQL.execute(sql11)
		if rs2("memcon") <> 0 then	%>
	<script language='Javascript'>
	alert('The Member Id in the selected course is Already Exists, Try Again....'); 
		<%	else	
		  	response.redirect "succeedpayment.asp"
			end if		
			<script language='Javascript'>
		  		alert('Username Already Exists, Try Again....') 
		end if
		'set rs2=nothing
	set rs = nothing 
	end if	
<script language="JavaScript">
	function validate_all()
		if (document.regfrm.txtfname.value=="")
			errmsg = " Firstname Field is Blank \n";
		if (document.regfrm.txtaddr1.value=="")
			errmsg += " Address Field is Blank \n";
		if (document.regfrm.txtcity.value=="")
			errmsg += " City Field is Blank \n";		
		if (document.regfrm.txtstate.value=="")
			errmsg += " State Field is Blank \n";
		if (document.regfrm.txtpcode.value=="")
			errmsg += " Zip Code Field is Blank \n";		
		if (document.regfrm.txtcontactno.value=="")
			errmsg += " Contact Number Field is Blank \n";		
		if (document.regfrm.txtemailid.value=="")
			errmsg += " Email ID Field is Blank \n";		
			var err=0
			mailid = document.regfrm.txtemailid.value;
			if (val!=-1)
			  if (val1==-1)
			if (err==1)
				  errmsg += " Invalid Email ID \n";
		if (document.regfrm.txtcourseid.value=="")
			errmsg += " Choose the Any one of the Course \n";
		if (document.regfrm.txtmemberid.value=="")
			errmsg += " GolfCourse membership Id Field is Blank \n";		
		if (document.regfrm.txtmemberid.value=="")
			errmsg += " GolfCourse membership Id Field is Blank \n";
		if (document.regfrm.txtuname.value=="")
			errmsg += " Username Field is Blank \n";		
		if (document.regfrm.txtpwd.value=="")
			errmsg += " Password Field is Blank \n";		
		else if (document.regfrm.txtpwd.value!=document.regfrm.txtcpwd.value)
			errmsg += " Confirm Password Doesn't Match with Original Password \n";		
	if (errmsg=="")         
		return true;
		alert(" Following Error Have Occured While Submiting This Form:\n\n"+errmsg);
		return false;
<body background="<%=level%>images/bg.jpg" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="516" border="0" align="center" cellpadding="0" cellspacing="0">
    <td colspan="4" valign="top"><font face="Tahoma" size="2"><!--#include file="../include/header.asp"-->
    <td width="192" valign="top" bgcolor="#ffffff"><font face="Tahoma" size="2">
      <!-- #include file="../include/left.asp" -->
    <td width="456" valign="top" bgcolor="#ffffff">
If Request.Querystring("err") = "captcha" then
<div align="center" style="color: red;">There was an error with the letters you entered.  Please look at the image in the form and type the letters you see.</div>
End if
      <form name="regfrm" method="post" action="succeedpayment.asp" onSubmit="return validateNumber(this.theField.value )">
	  <font face="Tahoma" size="2">
	  <% if (msg<>"") then %>
        <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0">
            <td width="100%" height="30" colspan="2" align="center">
			<font face="Tahoma" size="2"><%=msg%></font></td>
       <font face="Tahoma" size="2">
       <% end if %>
        <table width="423"  border="0" cellspacing="0" cellpadding="0" align="center" class="bodytxt1">
            <td width="28"><font face="Tahoma" size="2"><img src="<%=Level%>images/tbleft.jpg" width="28" height="24"></font></td>
            <td width="201" class="tableheader1"><font face="Tahoma" size="2"> New User Sign Up &nbsp;</font>			</td>
            <td width="194"><font face="Tahoma" size="2"><img src="<%=Level%>images/tbright.jpg" width="28" height="24"></font></td>
            <td colspan="3" valign="top" bgcolor="#5eb020"> 
              <table width="100%"  border="0" cellspacing="1" cellpadding="0">
                  <td valign="top" bgcolor="#FFFFFF" class="tablebgcolor"> 
                    <table width="100%" height="100%" align="center" cellpadding="5" cellspacing="0" class="bodytxt1" >
                      <tr align="left">
                        <td colspan="2" class="tableheader" >
						<font face="Tahoma" size="2">Personal Information</font></td>
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">First 
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
         <input name="txtfname" type="text" class="txtbox1" id="txtfname" onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Last Name</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input name="txtlname" type="text" class="txtbox1" id="txtlname" onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
                          <font size="2">
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Address</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input type="text" name="txtaddr1" class="txtbox2"></font></td>
                        <td width="40%" >&nbsp;</td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input type="text" name="txtaddr2" class="txtbox2"></font></td>
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">City 
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input type="text" name="txtcity" class="txtbox1" onKeyDown="
   if ( !isAlpha ( event ) ) {
      alert ( 'Please enter only letters on this field .' );
      return false;
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">State</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <select name="txtstate" class="txtbox1">
                            <option selected>--Choose a State--</option>
                            <option value="AL">Alabama</option>
                            <option value="AK">Alaska</option>
                            <option value="AZ">Arizona</option>
                            <option value="AR">Arkansas</option>
                            <option value="CA">California</option>
                            <option value="CO">Colorado</option>
                            <option value="CT">Connecticut</option>
                            <option value="DE">Delaware</option>
                            <option value="FL">Florida</option>
                            <option value="GA">Georgia</option>
                            <option value="HI">Hawaii</option>
                            <option value="ID">Idaho</option>
                            <option value="IL">Illinois</option>
                            <option value="IN">Indiana</option>
                            <option value="IA">Iowa</option>
                            <option value="KS">Kansas</option>
                            <option value="KY">Kentucky</option>
                            <option value="LA">Louisiana</option>
                            <option value="ME">Maine</option>
                            <option value="MD">Maryland</option>
                            <option value="MA">Massachusetts</option>
                            <option value="MI">Michigan</option>
                            <option value="MN">Minnesota</option>
                            <option value="MS">Mississippi</option>
                            <option value="MO">Missouri</option>
                            <option value="MT">Montana</option>
                            <option value="NE">Nebraska</option>
                            <option value="NV">Nevada</option>
                            <option value="NH">New Hampshire</option>
                            <option value="NJ">New Jersey</option>
                            <option value="NM">New Mexico</option>
                            <option value="NY">New York</option>
                            <option value="NF">Newfoundland</option>
                            <option value="NC">North Carolina</option>
                            <option value="ND">North Dakota</option>
                            <option value="OH">Ohio</option>
                            <option value="OK">Oklahoma</option>
                            <option value="OR">Oregon</option>
                            <option value="PA">Pennsylvania</option>
                            <option value="RI">Rhode Island</option>
                            <option value="SC">South Carolina</option>
                            <option value="SD">South Dakota</option>
                            <option value="TN">Tennessee</option>
                            <option value="TX">Texas</option>
                            <option value="UT">Utah</option>
                            <option value="VT">Vermont</option>
                            <option value="VA">Virginia</option>
                            <option value="WA">Washington</option>
                            <option value="DC">Washington, D.C.</option>
                            <option value="WV">West Virginia</option>
                            <option value="WI">Wisconsin</option>
                            <option value="WY">Wyoming</option>
                      <!--  <tr bgcolor="#FFFFFF"> 
                  <td width="40%" align="right" >Country</td>
                  <td width="60%"> &nbsp; <select name="optcountry" class="combobox1">
                      <option value="">--Select Any One--</option>
                      <option value="AF">Afghanistan</option>
                      <option value="AL">Albania</option>
                      <option value="DZ">Algeria</option>
                      <option value="AS">American Samoa</option>
                      <option value="AD">Andorra</option>
                      <option value="AO">Angola</option>
                      <option value="AI">Anguilla</option>
                      <option value="AQ">Antarctica</option>
                      <option value="AG">Antigua and Barbuda</option>
                      <option value="AR">Argentina</option>
                      <option value="AM">Armenia</option>
                      <option value="AW">Aruba</option>
                      <option value="AU">Australia</option>
                      <option value="AT">Austria</option>
                      <option value="AZ">Azerbaijan</option>
                      <option value="BS">Bahamas</option>
                      <option value="BH">Bahrain</option>
                      <option value="BD">Bangladesh</option>
                      <option value="BB">Barbados</option>
                      <option value="BY">Belarus</option>
                      <option value="BE">Belgium</option>
                      <option value="BZ">Belize</option>
                      <option value="BJ">Benin</option>
                      <option value="BM">Bermuda</option>
                      <option value="BT">Bhutan</option>
                      <option value="BO">Bolivia</option>
                      <option value="BA">Bosnia Hercegovina</option>
                      <option value="BW">Botswana</option>
                      <option value="BV">Bouvet Island</option>
                      <option value="BR">Brazil</option>
                      <option value="IO">British Indian Ocean Territory</option>
                      <option value="BN">Brunei Darussalam</option>
                      <option value="BG">Bulgaria</option>
                      <option value="BF">Burkina Faso</option>
                      <option value="BI">Burundi</option>
                      <option value="KH">Cambodia</option>
                      <option value="CM">Cameroon</option>
                      <option value="CA">Canada</option>
                      <option value="CV">Cape Verde</option>
                      <option value="KY">Cayman Islands</option>
                      <option value="CF">Central African Republic</option>
                      <option value="TD">Chad</option>
                      <option value="CL">Chile</option>
                      <option value="CN">China</option>
                      <option value="CX">Christmas Island</option>
                      <option value="CC">Cocos (Keeling) Islands</option>
                      <option value="CO">Colombia</option>
                      <option value="KM">Comoros</option>
                      <option value="CG">Congo</option>
                      <option value="CK">Cook Islands</option>
                      <option value="CR">Costa Rica</option>
                      <option value="CI">Cote D'ivoire</option>
                      <option value="HR">Croatia</option>
                      <option value="CU">Cuba</option>
                      <option value="CY">Cyprus</option>
                      <option value="CZ">Czech Republic</option>
                      <option value="DK">Denmark</option>
                      <option value="DJ">Djibouti</option>
                      <option value="DM">Dominica</option>
                      <option value="DO">Dominican Republic</option>
                      <option value="TP">East Timor</option>
                      <option value="EC">Ecuador</option>
                      <option value="EG">Egypt</option>
                      <option value="SV">EL Salvador</option>
                      <option value="GQ">Equatorial Guinea</option>
                      <option value="ER">Eritrea</option>
                      <option value="EE">Estonia</option>
                      <option value="ET">Ethiopia</option>
                      <option value="FK">Falkland Islands (Malvinas)</option>
                      <option value="FO">Faroe Islands</option>
                      <option value="FJ">Fiji</option>
                      <option value="FI">Finland</option>
                      <option value="FR">France</option>
                      <option value="GF">French Guiana</option>
                      <option value="PF">French Polynesia</option>
                      <option value="TF">French Southern Territories</option>
                      <option value="GA">Gabon</option>
                      <option value="GM">Gambia</option>
                      <option value="GE">Georgia</option>
                      <option value="DE">Germany</option>
                      <option value="GH">Ghana</option>
                      <option value="GI">Gibraltar</option>
                      <option value="GR">Greece</option>
                      <option value="GL">Greenland</option>
                      <option value="GD">Grenada</option>
                      <option value="GP">Guadeloupe</option>
                      <option value="GU">Guam</option>
                      <option value="GT">Guatemala</option>
                      <option value="GN">Guinea</option>
                      <option value="GW">Guinea-Bissau</option>
                      <option value="GY">Guyana</option>
                      <option value="HT">Haiti</option>
                      <option value="HM">Heard and Mc Donald Islands</option>
                      <option value="HN">Honduras</option>
                      <option value="HK">Hong Kong</option>
                      <option value="HU">Hungary</option>
                      <option value="IS">Iceland</option>
                      <option value="IN">India</option>
                      <option value="ID">Indonesia</option>
                      <option value="IR">Iran</option>
                      <option value="IQ">Iraq</option>
                      <option value="IE">Ireland</option>
                      <option value="IL">Israel</option>
                      <option value="IT">Italy</option>
                      <option value="JM">Jamaica</option>
                      <option value="JP">Japan</option>
                      <option value="JO">Jordan</option>
                      <option value="KZ">Kazakhstan</option>
                      <option value="KE">Kenya</option>
                      <option value="KI">Kiribati</option>
                      <option value="KP">Korea (North)</option>
                      <option value="KR">Korea (South)</option>
                      <option value="KW">Kuwait</option>
                      <option value="KG">Kyrgyzstan</option>
                      <option value="LA">Laos</option>
                      <option value="LV">Latvia</option>
                      <option value="LB">Lebanon</option>
                      <option value="LS">Lesotho</option>
                      <option value="LR">Liberia</option>
                      <option value="LY">Libyan Arab Jamahiriya</option>
                      <option value="LI">Liechtenstein</option>
                      <option value="LT">Lithuania</option>
                      <option value="LU">Luxembourg</option>
                      <option value="MO">Macau</option>
                      <option value="MK">Macedonia</option>
                      <option value="MG">Madagascar</option>
                      <option value="MW">Malawi</option>
                      <option value="MY">Malaysia</option>
                      <option value="MV">Maldives</option>
                      <option value="ML">Mali</option>
                      <option value="MT">Malta</option>
                      <option value="MH">Marshall Islands</option>
                      <option value="MQ">Martinique</option>
                      <option value="MR">Mauritania</option>
                      <option value="MU">Mauritius</option>
                      <option value="YT">Mayotte</option>
                      <option value="MX">Mexico</option>
                      <option value="FM">Micronesia</option>
                      <option value="MC">Monaco</option>
                      <option value="MN">Mongolia</option>
                      <option value="MS">Montserrat</option>
                      <option value="MA">Morocco</option>
                      <option value="MZ">Mozambique</option>
                      <option value="MM">Myanmar</option>
                      <option value="NA">Nambia</option>
                      <option value="NR">Nauru</option>
                      <option value="NP">Nepal</option>
                      <option value="NL">Netherlands</option>
                      <option value="AN">Netherlands Antilles</option>
                      <option value="NC">New Caledonia</option>
                      <option value="NZ">New Zealand</option>
                      <option value="NI">Nicaragua</option>
                      <option value="NE">Niger</option>
                      <option value="NG">Nigeria</option>
                      <option value="NU">Niue</option>
                      <option value="NF">Norfolk Island</option>
                      <option value="MP">Northern Mariana Islands</option>
                      <option value="NO">Norway</option>
                      <option value="OM">Oman</option>
                      <option value="OT">Others</option>
                      <option value="PK">Pakistan</option>
                      <option value="PW">Palau</option>
                      <option value="PS">Palestinian Territory, Occupied</option>
                      <option value="PA">Panama</option>
                      <option value="PG">Papua New Guinea</option>
                      <option value="PY">Paraguay</option>
                      <option value="PE">Peru</option>
                      <option value="PH">Philippines</option>
                      <option value="PN">Pitcairn</option>
                      <option value="PL">Poland</option>
                      <option value="PT">Portugal</option>
                      <option value="PR">Puerto Rico</option>
                      <option value="QA">Qatar</option>
                      <option value="MD">Republic Of Moldova</option>
                      <option value="RE">Reunion</option>
                      <option value="RO">Romania</option>
                      <option value="RU">Russia</option>
                      <option value="RW">Rwanda</option>
                      <option value="KN">Saint Kitts And Nevis</option>
                      <option value="LC">Saint Lucia</option>
                      <option value="VC">Saint Vincent and The Grenadines</option>
                      <option value="WS">Samoa</option>
                      <option value="SM">San Marino</option>
                      <option value="ST">Sao Tome and Principe</option>
                      <option value="SA">Saudi Arabia</option>
                      <option value="SN">Senegal</option>
                      <option value="SC">Seychelles</option>
                      <option value="SL">Sierra Leone</option>
                      <option value="SG">Singapore</option>
                      <option value="SK">Slovakia</option>
                      <option value="SI">Slovenia</option>
                      <option value="SB">Solomon Islands</option>
                      <option value="SO">Somalia</option>
                      <option value="ZA">South Africa</option>
                      <option value="GS">South Georgia And South Sandwich Islands</option>
                      <option value="ES">Spain</option>
                      <option value="LK">Sri Lanka</option>
                      <option value="SH">St. Helena</option>
                      <option value="PM">St. Pierre and Miquelon</option>
                      <option value="SD">Sudan</option>
                      <option value="SR">Suriname</option>
                      <option value="SJ">Svalbard and Jan Mayen Islands</option>
                      <option value="SZ">Swaziland</option>
                      <option value="SE">Sweden</option>
                      <option value="CH">Switzerland</option>
                      <option value="SY">Syrian Arab Republic</option>
                      <option value="TW">Taiwan</option>
                      <option value="TJ">Tajikistan</option>
                      <option value="TZ">Tanzania</option>
                      <option value="TH">Thailand</option>
                      <option value="TG">TOGO</option>
                      <option value="TK">Tokelau</option>
                      <option value="TO">Tonga</option>
                      <option value="TT">Trinidad and Tobago</option>
                      <option value="TN">Tunisia</option>
                      <option value="TR">Turkey</option>
                      <option value="TM">Turkmenistan</option>
                      <option value="TC">Turks and Caicos Islands</option>
                      <option value="TV">Tuvalu</option>
                      <option value="UG">Uganda</option>
                      <option value="UA">Ukraine</option>
                      <option value="AE">United Arab Emirates</option>
                      <option value="GB">United Kingdom</option>
                      <option value="US" selected>United States</option>
                      <option value="UM">United States Minor Outlying Islands</option>
                      <option value="UY">Uruguay</option>
                      <option value="UZ">Uzbekistan</option>
                      <option value="VU">Vanuatu</option>
                      <option value="VA">Vatican City State (Holy See)</option>
                      <option value="VE">Venezuela</option>
                      <option value="VN">Viet Nam</option>
                      <option value="VG">Virgin Islands (British)</option>
                      <option value="VI">Virgin Islands (U.S.)</option>
                      <option value="WF">Wallis and Futuna Islands</option>
                      <option value="EH">Western Sahara</option>
                      <option value="YE">Yemen</option>
                      <option value="YU">Yugoslavia</option>
                      <option value="CD" >Zaire</option>
                      <option value="ZM">Zambia</option>
                      <option value="ZW">Zimbabwe</option>
                    </select> </td>
                </tr> -->
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Zip Code</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input name="txtpcode" type="text" class="txtbox1" id="txtpcode" onBlur="MM_validateForm('txtpcode','','NisNum');return document.MM_returnValue" maxlength="5">
                          <font size="2">
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Contact 
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input name="txtcontactno" type="text" class="txtbox1" id="txtcontactno" onBlur="YY_checkform('regfrm');return document.MM_returnValue" maxlength="15">
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Email Address</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input name="txtemailid" type="text" class="combobox1" id="txtemailid" onBlur="MM_validateForm('txtemailid','','NisEmail');return document.MM_returnValue">
                          <font size="2">
                        <td height="25" align="right">
						<font face="Tahoma" size="2">Course</font></td>
                        <td height="25"><font face="Tahoma"><font size="2">&nbsp; 
                         <!-- retrieve courses list from playerscores.mdb - courses table-->
                          <select name=txtcourseid class="combobox1">
                            <option value="">--Choose The Course--</option>
							  set Rs_Course = conSQL.execute("select * from courses")
							  while Not Rs_Course.Eof 
							  response.Write("<option value="&Rs_Course("CourseID")&">"&Rs_Course("Name")&"		                              </option>")							  	
                        <td height="25" align="right">
						<p align="left"><font face="Tahoma" size="2">Golf Course 
						Membership ID</font></td>
                        <td height="25"><font face="Tahoma"><font size="2">&nbsp;
                          <input name="txtmemberid" type="text" id="txtmemberid" maxlength="14">
                        <td colspan="2" class="tableheader">
						<font face="Tahoma" size="2">Login 
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Username</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                          <input type="text" name="txtuname" class="txtbox1"><font size="2">
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Password</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
                           <input type="password" name="txtpwd" class="txtbox1"></font></td>
                        <td width="40%" align="right" >
						<font face="Tahoma" size="2">Confirm Password</font></td>
                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 
  <input type="password" name="txtcpwd" class="txtbox1"><font size="2"> </font>
                      <tr align="center" > 
                        <td colspan="2" > 
                        <div align = "center" > <p align="center">
                          <!-- include the Web Wiz CAPTCHA form -->
<!--#include file="CAPTCHA/CAPTCHA_form_inc.asp" --> 
                            <font face="Tahoma">  
                <input type="submit" name="Submit" value="Submit" class="button1" onClick="return validate_all()">
                            <input type="reset" name="Submit2" value="Reset" class="button1">
                               <font size="2">
                               </font></font> </div></td>
        <font face="Tahoma" size="2">
    </form>    </td>
    <td width="1" valign="top" bgcolor="#285E8E"></td>
    <td width="161" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
    <td colspan="4">
      <font face="Tahoma" size="2">
      <!--#include file="../include/footer.asp"-->

Open in new window

Question by:RickyGtz
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
LVL 16

Expert Comment

ID: 22743701
Well I do not see an "Insert" statement anywhere on the code above.  Plus your title says "Session Variable", what is the problem with those?
LVL 11

Expert Comment

ID: 22743710
Can you be more specific as to where the error is occurring? After a quick scroll through the code I don't see any place where a database insert is attempted.

Author Comment

ID: 22744266
I am sorry, this is the asp that inserts on database is called succeedpayment.asp, it supposses to get the session variables from the index.asp form and send email to txtemailid field entered.

<% response.buffer=true
<!--include file="../include/connection.asp"-->
<!--#include file="../../Connections/sqlConn1.asp" -->
<!--#include file="../../Connections/sqlConn3.asp" -->
<!--#include file="rc4.inc"-->
<!-- Include file for CAPTCHA configuration -->
<!-- #include file="CAPTCHA/CAPTCHA_configuration.asp" -->
<!-- Include file for CAPTCHA form processing --> 
<!-- #include file="CAPTCHA/CAPTCHA_process_form.asp" -->
		' Generating Random Number to use as e-mail refer
		set RecsetRef= conSQL.execute("select max(referenceno) from Players")
		If isnull(RecsetRef(0)) Then 
			S_ReferenceNumber =  RecsetRef(0)
		End If
		Set RecsetRef = Nothing 
'		psw="playerscores"	
'		stime = timer
'		strTemp = EnDeCrypt(ReferenceNumber, psw)
 If "" & Request("txtemailid") <> "" Then 
    If blnCAPTCHAcodeCorrect <> True then
	Session("email") = Request("txtemailid")
       Session("name") = Request("txtfname")
        Session("Message") = Request("Message")
       'Place code here that is to run if CAPTCHA is NOT entered correctly 
       Response.Write("CAPTCHA code is NOT correct")
	   Response.Redirect "index.asp?err=captcha"
 end if 
	' Retrieving from the Sigup form
conSQL.execute("Insert into Players(SSN,[password],firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,referenceno,courseid,memberid) values('"&txtuname&"','"&txtpwd&"','"&txtfname&"','"&txtlname&"','"&txtaddr1&"','"&txtaddr2&"','"&txtcity&"','"&txtstate&"','"&txtpcode&"','"&txtcontactno&"','"&txtemailid&"','"&regdate&"','"&regtime&"',"&ReferenceNumber&","&txtcourseid&",'"&txtmemberid&"')")
		If Err.Number <> 0 Then
		Response.Write "Error: " & Err.Description
			Response.Write "Unable to Store your Information "
'Send Mail with CDOSYS
sql="<html><body><b>Dear Member,</b><br><br>  Your account information has Been verified by playerscores.com staff.<br>Your account has been activated. <br><br>Your Username - "&txtuname&"<br>Your Password - "&txtpwd&" <br><br> Important information - Please write down this reference # to edit your <br> account with www.playerscores.com/ <br>  Your Reference Number is :"&ReferenceNumber&" <br> <br>  To Confirm your membership click on the link below,<br><a href='http://www.playerscores.com/members/verify.asp?refno="&ReferenceNumber&"'>http://www.playerscores.com/members/verify.asp?refno="&ReferenceNumber&"</a><br><br> <BR>  Please don't hesitate to email us if any questions should arise. <br><BR>  Thanks,<BR>  Playerscores staff<BR>  info@playerscores.com</body></html>"
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Thanks For your Registration with Playerscores.com "
myMail.To= txtemailid
myMail.HTMLBody= sql
myMail.Configuration.Fields.Item _
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
If Err.Number <> 0 Then
				Response.Write "Error: " & Err.Description
			    end if
				' clean up 
				set myMail=nothing
    End if
     Else %>
<script language="JavaScript" type="text/javascript">javascript: window.history.back(-1)</script>
<% End IF %>
'		psw="playerscores"	
'		stime = timer
'		strTemp = EnDeCrypt(ReferenceNumber, psw)
	' Insert newly registered member into Mailing list		
		Randomize Timer
		'Calculate a code for the user
		strUserCode = Left(txtemailid,2) & (9876989856 * CInt((RND * 32000) + 100))
		con3SQL.Execute("insert into tblMailingList (Email,ID_Code) values('"&txtemailid&"','"&	        strUserCode&"')")		
		'con7.execute("update tblauthor set Active = 1 where username='"&request("SSN")&"'")
	response.redirect "../Forum/register.asp?mode=new"	
		response.redirect "thank.asp"

Open in new window

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 16

Expert Comment

ID: 22744303
well this
If "" & Request("txtemailid") <> "" Then

should just be this
If Trim(Request("txtemailid")) <> "" Then
LVL 11

Expert Comment

ID: 22744533
Can you post the actual error? A single quote in any field being submitted will break that insert statement.

Author Comment

ID: 22744555
well the page is up on the server
the web reference is


LVL 11

Accepted Solution

flipz earned 1000 total points
ID: 22748147
On the succeedpayment.asp page change the variables so that that retrieve from the form - not the session variables.

' Retrieving from the Sigup form
txtfname = request.form("txtname")
txtlname = request.form("txtlname")

The parameters do not appear to be saved in session variables before they are being inserted.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question