asp-classic

Rewrite Rule to Rewrite All EXCEPT File Extension

谁说我不能喝 提交于 2019-12-06 09:27:07
I've got a rule setup to rewrite everything going into a subdirectory like so: <rule name="Forms Directory" stopProcessing="true"> <match url="^forms/(.*)" /> <action type="Redirect" url="forms.htm" redirectType="Permanent" /> </rule> However, I want to make a slight change to allow it to access an ASP file in the forms folder. So I want to keep the same rule but exclude any .asp from matching the rule. I tried the following but couldn't get it to operate as expected: <rule name="Forms Directory" stopProcessing="true"> <match url="^forms/(.*)[^(.asp)]" /> <action type="Redirect" url="forms.htm

How to test for an empty SQL result in ASP

给你一囗甜甜゛ 提交于 2019-12-06 09:25:14
I am running a query from ASP using a MySQL database, I want to create a variable (ssResult) based on the result with a person's name (fullname), if the record does not exist I want to assign the text 'N/A' to the variable, code below, I currently use a function getOther for my database connections which passes the column name "fullname": ssResult = getOtherElse("SELECT fullname FROM table WHERE id=" & inArr(j), "fullname") Below is the code for the function getOtherElse which only works when a result is returned but not when there is an empty result: Function getOtherElse(inSQL, getColumn)

How to see the actual server side error message in the browser?

早过忘川 提交于 2019-12-06 08:53:55
I'm having a trouble reproducing an issue a user is having in IE, but something that always bugged me is how can I see the error message from classic ASP page in IE for example on a dev server. In IE all I see is for example: This page contains programming error And that's it. Note: since this is server side, it applies to all browsers. I remember this one! You need to go into ie settings > advanced > uncheck "show friendly http errors" Gabs Is the problem just in IE? anyway i found this link that might be helpfull: Is try-catch like error handling possible in ASP Classic? 来源: https:/

ASP Classsic - Insert into Excel .XLS columns or Create a Real Excel Format File

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 07:27:09
I would like to add my MS SQL data into the Excel .XLS file below. I tried the following: <% Response.Clear Response.Buffer = False Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "attachment;filename=example.xls" ' --OPEN MS SQL DATABASE CODE-- ' --OPEN RECORDSET CODE-- %> <table> <tr> <th>DEBNAME</th> <th>INV_ID</th> <th>INV_DATE</th> <th>PO_NO</th> <th>INVAMT</th> </tr> <% 'START OF: ROW LOOP Do Until objRS.EOF %> <tr> <td><%=objRS("DEBNAME")%></td> <td><%=objRS("INV_ID")%></td> <td><%=objRS("INV_DATE")%></td> <td><%=objRS("PO_NO")%></td> <td><%

in Classic ASP, How to get if a dynamic array has elements inside?

我与影子孤独终老i 提交于 2019-12-06 07:26:31
问题 If I declare a dynamic sized array like this Dim myArray() Then how I can get in the code if this array is empty or it contains elements? I tried with IsArray(myArray) function that give me always True, otherwise if I try with UBound(myArray) function, I get an error. Any ideas? thanks in advance, Max 回答1: After declaring the array, you have to initialize it: Dim myArray() ReDim myArray(-1) Then such code will always work: If UBound(myArray)<0 Then 'array is empty.... Else 'array not empty...

Uploading photos - How can I keep our website safe/stable

拜拜、爱过 提交于 2019-12-06 07:16:44
问题 My website would like users to upload their photos...but how do I keep our server safe from harm? Allowing only JPGs should avoid virus trouble, but what if someone selects a 10Gb file - will that slow the whole website down? We're using Classic ASP and IIS6 (sorry, but that's how it is, can't change that!). Previously we have used a DLL from a company called Persits to handle uploads. However, it would be helpful to other people if we extend this discussion to other languages/technologies

HTML inside XML CDATA being converted with < and > brackets

这一生的挚爱 提交于 2019-12-06 07:12:38
I have some sample XML: <sample><![CDATA[Line 1<br />Line 2<br />Line 3<br />]]></sample> I'm using ASP to output this XML using a stylesheet like so: Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP") xmlHttp.open "GET", URLxml, false xmlHttp.send() Set xslHttp = Server.CreateObject("Microsoft.XMLHTTP") xslHttp.open "GET", xXsl, false xslHttp.send() Set xmlDoc = Server.CreateObject("MICROSOFT.XMLDOM") Set xslDoc = Server.CreateObject("MICROSOFT.XMLDOM") xmlDoc.async = false xslDoc.async = false xmlDoc.Load xmlHttp.responseXML xslDoc.Load xslHttp.responseXML Response.Write xmlDoc

How to implement Google Recaptcha 2.0 in ASP Classic?

 ̄綄美尐妖づ 提交于 2019-12-06 06:44:09
问题 I need help to implement the answer Google Recaptcha 2.0. I've tried a few ways to recover the response after sending the form but not consigui get the answer True. Follows the example I'm trying: recaptcha_secret = "example45454sasa" sendstring = _ "https://www.google.com/recaptcha/api/siteverify?" & _ "secret=" & recaptcha_secret & _ "&response=" & request.form("g-recaptcha-response") Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP") objXML.Open "GET", sendstring , false objXML.Send(

Collection of objects in classic ASP using VBScript?

帅比萌擦擦* 提交于 2019-12-06 06:43:51
问题 I have a class called 'Company' that has properties like 'CompanyName', 'CompanyCode' and 'IsActive'. This class is in VBScript. I want to store a collection of Company objects using VBScript in classic ASP. Is this possible, and if yes, then how would I do it? 回答1: You can use an array or a dictionary object: Array ' create an array with a fixed size dim companies(2) ' fill the array with the companies set companies(0) = Company1 set companies(1) = Company2 set companies(2) = Company3 '

share session between classic ASP and PHP over than using database

南笙酒味 提交于 2019-12-06 06:41:05
问题 We have an ASP intranet web application that have been developed over years which is running on IIS6. Nowadays, we would like to add some new functionalities using PHP language instead. PHP is running fine on the same server. Sessions variables need to be shared between both ASP and PHP. I am asking if there is other alternatives to share session between classic ASP and PHP instead of using database as gateway (too much resources consuming for us)? Both side need to read/edit session