Form Won't Submit

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
rcandela
Posts: 6
Joined: Mon Aug 27, 2012 3:42 am

Form Won't Submit

Post by rcandela » Thu Sep 13, 2012 4:15 am

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
	
	 
	
	
	

User avatar
jvierra
Posts: 13507
Joined: Tue May 22, 2007 9:57 am
Contact:

Form Won't Submit

Post by jvierra » Thu Sep 13, 2012 5:15 am

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)

User avatar
jvierra
Posts: 13507
Joined: Tue May 22, 2007 9:57 am
Contact:

Form Won't Submit

Post by jvierra » Thu Sep 13, 2012 5:18 am

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

User avatar
Ferdinand Rios
Posts: 372
Joined: Tue Nov 14, 2006 2:56 am

Form Won't Submit

Post by Ferdinand Rios » Thu Sep 13, 2012 5:34 am

The file attached fine. I see it with no problem. What issues with attachments are you experiencing?
F.G. Rios

User avatar
jvierra
Posts: 13507
Joined: Tue May 22, 2007 9:57 am
Contact:

Form Won't Submit

Post by jvierra » Thu Sep 13, 2012 8:30 am

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

User avatar
Alexander Riedel
Posts: 6921
Joined: Tue May 29, 2007 4:43 pm

Form Won't Submit

Post by Alexander Riedel » Thu Sep 13, 2012 8:36 am

I click on the link as shown and the file opens just fine....


Attached files
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
jvierra
Posts: 13507
Joined: Tue May 22, 2007 9:57 am
Contact:

Form Won't Submit

Post by jvierra » Thu Sep 13, 2012 8:37 am

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

Locked