Solved

Incorrect Syntax on sql insert statement

Posted on 2008-10-20
8
1,026 Views
Last Modified: 2011-04-14
I am having an error 1292Error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near ','.

while inserting values from a form into sql database this is the code .


<%
 

' If "" & Request("txtemailid") <> "" Then

    'If Trim(Request("txtemailid")) <> "" Then 

    If blnCAPTCHAcodeCorrect <> True then

       '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

	

		

		' Generating Random Number 

		set RecsetRef= conSQL.execute("select max(referenceno) from Players")

		

		If isnull(RecsetRef(0)) Then 

			ReferenceNumber=1001

		else

			S_ReferenceNumber =  RecsetRef(0)

			ReferenceNumber=S_ReferenceNumber+1

		End If

		RecsetRef.close

		Set RecsetRef = Nothing 

		Response.Write(ReferenceNumber)
 

'		psw="playerscores"	

'		stime = timer

'		strTemp = EnDeCrypt(ReferenceNumber, psw)
 
 

		' Retrieving from the Sigup form

		txtfname=session("S_txtfname")

		txtlname=session("S_txtlname")

		txtaddr1=session("S_txtaddr1")

		txtaddr2=session("S_txtaddr2")

		txtcity=session("S_txtcity")

		txtstate=session("S_txtstate")

		optcountry=session("S_optcountry")

		txtpcode=session("S_txtpcode")

		txtcourseid=session("S_txtcourseid")

		txtmemberid=session("S_txtmemberid")

		txtcontactno=session("S_txtcontactno")

		txtemailid=session("S_txtemailid")

		txtuname=session("S_txtuname")

		txtpwd=session("S_txtpwd")

		

		txtsecuritycode=session("S_securitycode")

		

		regdate=date()

		regtime=time()

	

		on error resume next

		

 ' If blnCAPTCHAcodeCorrect = True    Then

  ' Response.Write(" CAPTCHA code is correct")

  'ElseIf    blnCAPTCHAcodeCorrect = False    Then

   'Response.Redirect("submisionerror.asp")

  ' Response.Flush

   'End If

  

  

		

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.end

			Response.Write "Unable to Store your Information "

			response.end

		else

		    session("username")=txtuname

			

'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.From="info@playerscores.com"

myMail.To= txtemailid

myMail.HTMLBody= sql

myMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

'Name or IP of remote SMTP server

myMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") _

="192.168.5.235"

'Server port

myMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _

=25 

myMail.Configuration.Fields.Update

myMail.Send

If Err.Number <> 0 Then

				Response.Write "Error: " & Err.Description

			    response.end

			    end if

				

				' clean up 

				set myMail=nothing

Open in new window

0
Comment
Question by:RickyGtz
  • 4
  • 4
8 Comments
 
LVL 7

Expert Comment

by:ASPSQLServerCOM
Comment Utility
hi, instead of writing

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&"')")
 

just comment this line and

response.write("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&"')")
 
you will get your SQL and then it will be easey for you to know where it has problem
0
 
LVL 7

Expert Comment

by:ASPSQLServerCOM
Comment Utility
also check for 5the column data type like Zip, is it number or string, because from code I can see it is trying to insert string
0
 

Author Comment

by:RickyGtz
Comment Utility
Hi I did that and this what I got

Insert into Players(SSN,[password],firstname,lastname,addy1,addy2,city,state,Zip,phone,email,regdate,regtime,referenceno,courseid,memberid) values('','','','','','','','','',,'','10/20/2008','12:54:56 PM',1294,,'')\

So It seems is not inserting  SSN, password, lastname......
only the regdate, and regtime....

any clue why i am no getting the values from the form ???
0
 

Author Comment

by:RickyGtz
Comment Utility
Register.asp
<%

' Member Registration 
 
 

	if 		(Request.Form("Submit")<>"") then

	

	

				txtcourseid=request.form("txtcourseid")

				txtmemberid=request.form("txtmemberid")

				session("S_txtfname")=request.form("txtfname")

				session("S_txtlname")=request.form("txtlname")

				session("S_txtaddr1")=request.form("txtaddr1")

				session("S_txtaddr2")=request.form("txtaddr2")

				session("S_txtcity")=request.form("txtcity")

				session("S_txtstate")=request.form("txtstate")

				

				' get the id of each course as parameter

				session("S_txtcourseid")=request.form("txtcourseid") 

				

				

				session("S_txtmemberid")=request.form("txtmemberid")

				session("S_txtpcode")=request.form("txtpcode")

				session("S_txtcontactno")=request.form("txtcontactno")

				session("S_txtemailid")=request.form("txtemailid")

				session("S_txtuname")=request.form("txtuname")

				session("S_txtpwd")=request.form("txtpwd")	

Open in new window

0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 7

Expert Comment

by:ASPSQLServerCOM
Comment Utility
hi, could you please copy paste total page code
0
 

Author Comment

by:RickyGtz
Comment Utility
Hi , this is my succeedpayment.asp page which gets the values after submitting a form and sends email to txtemailid.

<% response.buffer=true

 level="../"%>

 

<!--include file="../include/connection.asp"-->

<!--#include file="../../Connections/sqlConn1.asp" -->

<!--#include file="../../Connections/sqlConn3.asp" -->

<!--#include file="rc4.inc"-->
 

 

<!-- Include file for CAPTCHA form processing -->

<!-- #include file="CAPTCHA/CAPTCHA_process_form.asp" -->    

<!-- Include file for CAPTCHA configuration -->

<!-- #include file="CAPTCHA/CAPTCHA_configuration.asp" -->

      

<%
 

' If "" & Request("txtemailid") <> "" Then

    'If Trim(Request("txtemailid")) <> "" Then 

    If blnCAPTCHAcodeCorrect <> True then

       '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

	

		

		' Generating Random Number 

		set RecsetRef= conSQL.execute("select max(referenceno) from Players")

		

		If isnull(RecsetRef(0)) Then 

			ReferenceNumber=1001

		else

			S_ReferenceNumber =  RecsetRef(0)

			ReferenceNumber=S_ReferenceNumber+1

		End If

		RecsetRef.close

		Set RecsetRef = Nothing 

		Response.Write(ReferenceNumber)
 

'		psw="playerscores"	

'		stime = timer

'		strTemp = EnDeCrypt(ReferenceNumber, psw)
 
 

		' Retrieving from the Sigup form

		txtfname=session("S_txtfname")

		txtlname=session("S_txtlname")

		txtaddr1=session("S_txtaddr1")

		txtaddr2=session("S_txtaddr2")

		txtcity=session("S_txtcity")

		txtstate=session("S_txtstate")

		optcountry=session("S_optcountry")

		txtpcode=session("S_txtpcode")

		txtcourseid=session("S_txtcourseid")

		txtmemberid=session("S_txtmemberid")

		txtcontactno=session("S_txtcontactno")

		txtemailid=session("S_txtemailid")

		txtuname=session("S_txtuname")

		txtpwd=session("S_txtpwd")

		

		regdate=date()

		regtime=time()

	

		on error resume next

		

'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&"')")
 

response.write("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.end

			Response.Write "Unable to Store your Information "

			response.end

		else

		    session("username")=txtuname

			

'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.From="info@playerscores.com"

myMail.To= Request.form("txtemailid")

myMail.HTMLBody= sql

myMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

'Name or IP of remote SMTP server

myMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") _

="192.168.5.235"

'Server port

myMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _

=25 

myMail.Configuration.Fields.Update

myMail.Send

If Err.Number <> 0 Then

				Response.Write "Error: " & Err.Description

			    response.end

			    end if

				

				' clean up 

				set myMail=nothing
 
 
 

	' 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"

		end if

%>

Open in new window

0
 

Author Comment

by:RickyGtz
Comment Utility
This is index.asp ( The form )  the one that gets the values and displays the html content  to be filled.

And you can see it live at

http://www.playerscores.com/members/index.asp
<% 

	level="../"
 
 
 

<!--#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" -->
 
 
 

<html>

<head>

<title><%=PageTitle%></title>

<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,""));

    myV=myObj.value;

    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]);

        if(myAt){

          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);

          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};

        }else{addErr=true}

      } 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,""));

            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];

            if(!myObj1.checked){addErr=true}

      } else if (myV.length>0&&args[i+2]==6){ // the same

            var myObj1 = MM_findObj(args[i+1]);

            if(myV!=myObj1.value){addErr=true}

      }

    } 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'){

      if(args[i+2]==1&&myObj.checked==false){addErr=true}

      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}

    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){

      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}

    }else if (myObj.type=='textarea'){

      if(myV.length<args[i+1]){addErr=true}

    }

    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>
 

<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;

}

//-->

</script>
 
 

</head>

<%

' Member Registration 
 
 

	if 		(Request.Form("Submit")<>"") then

	

	

				txtcourseid=request.form("txtcourseid")

				txtmemberid=request.form("txtmemberid")

				session("S_txtfname")=request.form("txtfname")

				session("S_txtlname")=request.form("txtlname")

				session("S_txtaddr1")=request.form("txtaddr1")

				session("S_txtaddr2")=request.form("txtaddr2")

				session("S_txtcity")=request.form("txtcity")

				session("S_txtstate")=request.form("txtstate")

				

				' get the id of each course as parameter

				session("S_txtcourseid")=request.form("txtcourseid") 

				

				

				session("S_txtmemberid")=request.form("txtmemberid")

				session("S_txtpcode")=request.form("txtpcode")

				session("S_txtcontactno")=request.form("txtcontactno")

				session("S_txtemailid")=request.form("txtemailid")

				session("S_txtuname")=request.form("txtuname")

				session("S_txtpwd")=request.form("txtpwd")	

	

	

	    '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''		
 

' 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 ....'); 

						history.go(-1);

						</script>	

<% End If %>

<%
 
 
 

		'toaddress = Request.Form("recipient")

  		'.To = "&toaddress&"

					

		txtuname=request.form("txtuname")

		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....'); 

						history.go(-1);

						

					</script>

		<%	else	

		  	response.redirect "succeedpayment.asp"

			end if		

		else 

		%>

        

			<script language='Javascript'>

		  		alert('Username Already Exists, Try Again....') 

				history.go(-1)	

			</script>

			<%		

		end if

		'rs2.close

		'set rs2=nothing

	rs.close

	set rs = nothing 

	end if	

%>

<script language="JavaScript">

	function validate_all()

	{

		errmsg="";
 

		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";		

		else

		{

			var err=0

			mailid = document.regfrm.txtemailid.value;

			val=mailid.indexOf("@");

			if (val!=-1)

			{

			  val1=mailid.indexOf(".");

			  if (val1==-1)

				err=1;	

			}  

			else

				err=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;

	}

	else

	{

		alert(" Following Error Have Occured While Submiting This Form:\n\n"+errmsg);

		return false;

	}

}	

</script>
 
 

<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">

  <tr> 

    <td colspan="4" valign="top"><font face="Tahoma" size="2"><!--#include file="../include/header.asp"-->

	</font></td>

  </tr>

  <tr>

    <td width="192" valign="top" bgcolor="#ffffff"><font face="Tahoma" size="2">

      <!-- #include file="../include/left.asp" -->

	</font>

	</td>

    <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 %>

        </font>

        <table width="88%" border="0" align="center" cellpadding="0" cellspacing="0">

          <tr> 

            <td width="100%" height="30" colspan="2" align="center">

			<font face="Tahoma" size="2"><%=msg%></font></td>

          </tr>

        </table>

       <font face="Tahoma" size="2">

       <% end if %>

        </font>

        <table width="423"  border="0" cellspacing="0" cellpadding="0" align="center" class="bodytxt1">

          <tr>

            <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>

          </tr>

          <tr> 

            <td colspan="3" valign="top" bgcolor="#5eb020"> 

              <table width="100%"  border="0" cellspacing="1" cellpadding="0">

                <tr> 

                  <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>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">First 

                          Name</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

         <input name="txtfname" type="text" class="txtbox1" id="txtfname" onKeyDown="

   if ( !isAlpha ( event ) ) {

      alert ( 'Please enter only letters on this field .' );

      return false;

   }">
 

                        </font></td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Last Name</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

                          <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">

						</font></font>

                        </td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Address</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

                          <input type="text" name="txtaddr1" class="txtbox2"></font></td>

                      </tr>

                      <tr> 

                        <td width="40%" >&nbsp;</td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

                          <input type="text" name="txtaddr2" class="txtbox2"></font></td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">City 

                       

                        </font> 

                       

                        </td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                          </font> 

                          <input type="text" name="txtcity" class="txtbox1" onKeyDown="

   if ( !isAlpha ( event ) ) {

      alert ( 'Please enter only letters on this field .' );

      return false;

   }">

   

   </font></td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">State</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                                                   

                          <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>

                          </select>

                        </font></td>

                      </tr>
 

                      <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; 

                          

                          </font> 

                          

                          <input name="txtpcode" type="text" class="txtbox1" id="txtpcode" onBlur="MM_validateForm('txtpcode','','NisNum');return document.MM_returnValue" maxlength="5">

                          <font size="2">

						</font></font>

						

                        </td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Contact 

                          Number</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                        

                          </font> 

                        

                          <input name="txtcontactno" type="text" class="txtbox1" id="txtcontactno" onBlur="YY_checkform('regfrm');return document.MM_returnValue" maxlength="15">

                        </font></td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Email Address</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

                          <input name="txtemailid" type="text" class="combobox1" id="txtemailid" onBlur="MM_validateForm('txtemailid','','NisEmail');return document.MM_returnValue">

                          <font size="2">

						</font></font>

                        </td>

                      </tr>

                      <tr> 

                        <td height="25" align="right">

						<font face="Tahoma" size="2">Course</font></td>

                        <td height="25"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

                                      

                         

                          <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>")							  	

							  Rs_Course.MoveNext

							  wend 

							  %>

                        </select></font></td>

                      </tr>

                      <tr>

                        <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;

                          </font>

                          <input name="txtmemberid" type="text" id="txtmemberid" maxlength="14">

                        </font></td>

                      </tr>

                      <tr> 

                        <td colspan="2" class="tableheader">

						<font face="Tahoma" size="2">Login 

                          Information</font></td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Username</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                         

                          </font> 

                         

                          <input type="text" name="txtuname" class="txtbox1"><font size="2">

						</font></font>

                        </td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Password</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

                           </font> 

                           <input type="password" name="txtpwd" class="txtbox1"></font></td>

                      </tr>

                      <tr> 

                        <td width="40%" align="right" >

						<font face="Tahoma" size="2">Confirm Password</font></td>

                        <td width="60%"><font face="Tahoma"><font size="2">&nbsp; 

  						</font> 

  <input type="password" name="txtcpwd" class="txtbox1"><font size="2"> </font>

						</font>

                        </td></tr>

                      <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" --> 

 </p>

                         

                          

                          

                            <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>

                      </tr>

                    </table>

                  </td>

                </tr>

              </table>

            </td>

          </tr>

        </table>

        <font face="Tahoma" size="2">

        <br>

        <br>

      	</font>

    </form>    </td>

    <td width="1" valign="top" bgcolor="#285E8E"></td>

    <td width="161" valign="top" bgcolor="#FFFFFF">&nbsp;</td>

  </tr>

  <tr> 

    <td colspan="4">

      <font face="Tahoma" size="2">

      <!--#include file="../include/footer.asp"-->

    	</font>

    </td>

  </tr>

</table>

</body>

</html>

Open in new window

0
 
LVL 7

Accepted Solution

by:
ASPSQLServerCOM earned 250 total points
Comment Utility
hi,
on form index.asp you gave
 <form name="regfrm" method="post" action="succeedpayment.asp" onSubmit="return validateNumber(this.theField.value )">
      
I am not able to find the validateNumber method

also in form succeedpayment.asp , could you please remove session(".....")
txtfname=session("S_txtfname")
            txtlname=session("S_txtlname")
            txtaddr1=session("S_txtaddr1")
            txtaddr2=session("S_txtaddr2")
            txtcity=session("S_txtcity")
            txtstate=session("S_txtstate")
            optcountry=session("S_optcountry")
            txtpcode=session("S_txtpcode")
            txtcourseid=session("S_txtcourseid")
            txtmemberid=session("S_txtmemberid")
            txtcontactno=session("S_txtcontactno")
            txtemailid=session("S_txtemailid")
            txtuname=session("S_txtuname")
            txtpwd=session("S_txtpwd")

 and replace it with request.form(".......")

like txtlname=request.form("txtlname")



also could it be possible for you to varify that on the server you can create session

0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now