Page 1 of 1

Form Won't Submit

Posted: Thu Sep 13, 2012 4:15 am
by rcandela
I'm having troubles getting this form to work. I've dumped my entire asp page on here - but it just won't submit. I've verified that everything lines up with SQL - is there something wrong with the form?

Code: Select all

	Dim QUERY_STRING_INFO  
	QUERY_STRING_INFO = Replace(Request.QueryString("Id"), "{", "'")
	QUERY_STRING_INFO = Replace(QUERY_STRING_INFO, "}", "'")
	SQLString = "SELECT * FROM CRMLead WHERE Id = '" & request.QueryString("Id") & "';"
	Set rsUsersMod = Server.CreateObject("ADODB.Recordset")
	'Then open the record we want
	rsUsersMod.Open SQLString,dbConn,adLockReadOnly,adOpenDynamic
	
	SQLStringLeads = "SELECT * FROM CRMTask WHERE WhoId ='" & request.QueryString("Id") & "' ORDER BY ActivityDate DESC;"   
	Set rsTasks = Server.CreateObject("ADODB.Recordset")	
	rsTasks.Open SQLStringLeads,dbConn,adLockReadOnly,adOpenDynamic
	
	':::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
	' Update data into orders table
	'First check the user input and the action selected
	If Request.Form("update") = "modifylead" Then
		strSQL ="UPDATE CRMLead SET " &_
				"FirstName = '" & Request.Form("FirstName") & "', " &_
				"LastName = '" & Request.Form("LastName") & "', "  &_
				"Email = '" & Request.Form("Email") & "', " &_
				"Company = '" & Request.Form("Company") & "', " &_
				"Street = '" & Request.Form("Street") & "', " &_
				"City = '" & Request.Form("City") & "', " &_
				"State = '" & Request.Form("State") & "', " &_
				"PostalCode = '" & Request.Form("PostalCode") & "', " &_
				"Phone = '" & Request.Form("Phone") & "', " &_
				"WHERE Id = '" & Request.Form("recordid") & "';"
				dbConn.Execute(strSQL)
				IF ((Session("Level") = "Admin")) Then
				ErrorMess = "Information Has Been Updated!"
				Else
				Response.Redirect("crm_user.asp?id=" & rsUsersMod.Field.Item("Id").Value & "")
				End If
	End If
	
	 
	
	
	

Form Won't Submit

Posted: Thu Sep 13, 2012 5:15 am
by jvierra
Please post the code as a file attachment.

I will look at it but this is not really an ASP forum. We should have a section here for web where it is realated to Sapien tools as PrimalScript edits ASP quite nicely.

I recommend getting the sql into a function that you can run at a commandline until you get it to work correctly. Once it is working as a VBScritp then you can port it to ASP. ASP is tricky beciuse the web server generally cannot touch the database server. You are also portint values from a web form that are not being bounds checked. This can lead to and will almost certainly lead to a sql-injection attack.

Here is an example of how to start this as an attached file.

Your SQL is wrong and will not work anywhere. What you are trying to do is also almost impossible to determine fromteh code you posted.


Attached files /FileUpload/b1/c2873ec81ff9b5a9892665d2e32d95.txt (846 B)

Form Won't Submit

Posted: Thu Sep 13, 2012 5:18 am
by jvierra
Well I tried to attach a file but it won';t work until they fix the forum software.

Here is a link to a file with an example of how to proceed.

http://www.designedsystemsonline.com/up ... script.txt

Form Won't Submit

Posted: Thu Sep 13, 2012 5:34 am
by Ferdinand Rios
The file attached fine. I see it with no problem. What issues with attachments are you experiencing?

Form Won't Submit

Posted: Thu Sep 13, 2012 8:30 am
by jvierra
Are you talking about the link above or the file that looks like a piece of paper with the corner folded down?

The file appears to be there but it cannot be downloaded. Nothiing happens when it is clicked on

Form Won't Submit

Posted: Thu Sep 13, 2012 8:36 am
by Alexander Riedel
I click on the link as shown and the file opens just fine....


Attached files

Form Won't Submit

Posted: Thu Sep 13, 2012 8:37 am
by jvierra
Ok - the file I uploaded was a Unicode file. It would not display in IE8 on XP. I deleted it and uploaded an ansi version and now it displays correctly.

Maybe it was just that the file was corrupted. I could right click and select "Save Target As" and I could right-click and choose "OPen" but the file would not act like a hyperlink and disply as long as it was a Unicode file.

I think thsi meansd that you Mime typyes are no all set on the web server. A TXT extension can be Unicode and should be allowed as mime/text. Older web servers may not have that enabled or it may not be enabled because a server was upgraded in place from IIS6