How to perform an HTTP POST request in ASP?

You can try something like this: Set ServerXmlHttp = Server.CreateObject(“MSXML2.ServerXMLHTTP.6.0”) ServerXmlHttp.open “POST”, “http://www.example.com/page.asp” ServerXmlHttp.setRequestHeader “Content-Type”, “application/x-www-form-urlencoded” ServerXmlHttp.setRequestHeader “Content-Length”, Len(PostData) ServerXmlHttp.send PostData If ServerXmlHttp.status = 200 Then TextResponse = ServerXmlHttp.responseText XMLResponse = ServerXmlHttp.responseXML StreamResponse = ServerXmlHttp.responseStream Else ‘ Handle missing response or other errors here End If Set ServerXmlHttp = Nothing where PostData is the data … Read more

How to encrypt in VBScript using AES?

One way is to declare encryption classes within vbscript, without needing external added COM objects or wrapper. The following example takes a string, encrypts and decrypts using Rijndael managed class: ‘—————————————————– Dim obj,arr,i,r,str,enc,asc dim bytes,bytesd,s,sc,sd set obj=WScript.CreateObject(“System.Security.Cryptography.RijndaelManaged”) Set asc = CreateObject(“System.Text.UTF8Encoding”) s=”This is a private message” bytes=asc.GetBytes_4(s) obj.GenerateKey() obj.GenerateIV() set enc=obj.CreateEncryptor() set dec=obj.CreateDecryptor() bytec=enc.TransformFinalBlock((bytes),0,lenb(bytes)) sc=asc.GetString((bytec)) … Read more

How to resolve “The requested URL was rejected. Please consult with your administrator.” error?

Your http is being blocked by a firewall from F5 Networks called Application Security Manager (ASM). It produces messages like: Please consult with your administrator. Your support ID is: xxxxxxxxxxxx So your application is passing some data that for some reason ASM detects as a threat. Give the support id to your network engineer to … Read more

Error trying to call stored procedure with prepared statement

You want something like this (untested) Dim cmd, rs, ars, conn Set cmd = Server.CreateObject(“ADODB.Command”) With cmd ‘Assuming passing connection string if passing ADODB.Connection object ‘make sure you use Set .ActiveConnection = conn also conn.Open should ‘have been already called. .ActiveConnection = conn ‘adCmdStoredProc is Constant value for 4 (include adovbs or ‘set typelib in … Read more

IIS URL Rewrite ASP

If you want to use regular expressions you could do something like this <rule name=”RewriteUserFriendlyURL1″ stopProcessing=”true”> <match url=”^([^/]+)/([^/]+)/?$” /> <conditions> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” /> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> </conditions> <action type=”Rewrite” url=”default.asp?language={R:1}&amp;id={R:2}” /> </rule> This would rewrite “domain.com/en/service” as “domain.com/default.asp?language=en&id=Service”, or “domain.com/2/3” as “domain.com/default.asp?language=2&id=3” To change the 2 to en and the 3 … Read more