Sunday, 18 May 2008
|
| Passing parameters from ASP to MS Access query Mah-Skeet 21:14:37 |
| | Hi All,
First let me apologize if this isn't the right forum. I couldn't find an exact fit, but I'm desperate so...if you know where this should go please let me know.
Ok, I have a query in Access that runs fine if you enter empty parameters, but when I run the query from ASP I'm not getting any results (like I do in Access). Can anyone offer any advice? The code I'm using comes from http://www.xefteri.com/articles/show.cfm?id=6
Many thanks in advance,
Mark
|
| | 3 answer | Add comment |
|
| Bulkmail question Neil Gould 07:09:35 |
| | I'm preparing an ASP script to send email to club members via the club's website. In getting familiar with CDOSYS, I noticed that the recommended method of sending the same content to multiple recipients is to loop through the list of recipients. I had intended to BCC the message. Is there some reason to prefer looping through recipients?
The next task is to distribute the club's newsletter via one of the above approaches. Does this make one approach more desirable, and if so, why?
Thanks,
Neil
|
| | 9 answers | Add comment |
|
| Response.Addheader Tony 01:13:33 |
| | I've searched the web & can't find an answer to this.
Is it possible to successfully use Response.AddHeader for a robots meta tag?
For example, I want to do
<% IF request("PageID") = 252 THEN Response.AddHeader "robots", "noindex" : %>
|
| | 8 answers | Add comment |
Saturday, 17 May 2008
|
| Read from client machine Titus 15:33:11 |
| | Hi all, To secure my web site i need to read client Machien's MAC Address with javascript,
Can any body help me?
|
| | 2 answer | Add comment |
Friday, 16 May 2008
|
| divisiorn problem .nLL 23:35:04 |
| | <%=2/33334%>
returns 5.99988000239995E-05
how can i convert it to a n.nn ?
|
| | 3 answer | Add comment |
|
| IF exist /w FSO EQNish 21:17:47 |
| | IS there a way I can do an If exist to determin if a graphic is displayed?
something like this;
<p align="center">
if file exist "fileone.jpg" <img border="0" src="fileone.jpg"> if File exist "filetwo.jpg" <img border="0" src="fileone.jpg"> </p>
What I am trying to do is post JPGs from a folder structure, the files may or maynot be there, but I don't want to have the blank picture reference to be displayed as if I where to just hard code the graphics in the Html!
|
| | 2 answer | Add comment |
|
| CDO.Message problems Andrew Wan 19:01:21 |
| | I use CDO.Message to send mail. The problem is, CDO.Message will send to any malformed address, (eg. smtp:email.address@domain.com) and no errors are thrown. That's ok.
Is there any way to receive bounced messages?
|
| | 1 answer | Add comment |
|
| Problem getting hacked with this new SQL injection Tool. Adword71 and direct84 Lance Wynn 18:27:37 |
| | One of my server has been compromised from this virus, and I can't seem to block it out! I have shut down the infected server, but I need to figure out how to check for this, and stop it.
The site is running iis5 on Windows2000, the backend DB is SQLServer 2000
Can anyone point me to some good resources for this? This is urgent!
Thanks alot Lance
-- Support Fairtax Legislation www.fairtax.org
"A government big enough to give you everything you want, is strong enough to take everything you have." -Thomas Jefferson
|
| | 17 answers | Add comment |
Thursday, 15 May 2008
|
| RE: Problem getting hacked with this new SQL injection Tool. Adword71 Plange 21:09:01 |
| | This happened to me too, and it's some new SQL injection -- see http://cyberinsecure.com/phishing-botnet-expands-by-sql-injecting-websites-found-in-google/
"Lance Wynn" wrote:
One of my server has been compromised from this virus, and I can't seem to block it out! I have shut down the infected server, but I need to figure out how to check for this, and stop it. The site is running iis5 on Windows2000, the backend DB is SQLServer 2000 Can anyone point me to some good resources for this? This is urgent! Thanks alot Lance -- Support Fairtax Legislation "A government big enough to give you everything you want, is strong enough to take everything you have." -Thomas Jefferson |
| | Add comment |
|
| ADO issue (new) Dannasoft 19:57:22 |
| | I have a strange problem. ASP pages that have worked for years are suddenly giving me errors. Here's the scenario.
Server: Win2k Server running IIS
Opening ADODB recordsets. First recordset on page opens fine, but after closing it I try to use the same recordset object to open a second recordset and I get the following errror.
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21) ODBC driver does not support the requested properties.
Usually this is from a bad sql string used to open a recordset but the string is good. It only happens when re-using an existing recordset object to open a second recordset after closing the first.
Anyone experience this lately? Could it be some update on the server causing it?
|
| | 6 answers | Add comment |
|
| Opening a New Window with no toolbars etc Anon 14:16:44 |
| | I have a page where the ASP script create a table of links
i.e. 1 = NextPage.asp?Item=1 2 = NextPage.asp?Item=2
etc
What I would like to do is open an new window with this link without any toolbars, addressbars, scrollbars and tabs. I would be happy even if the control to limit the appearance of the new window was in the new asp page.
Any suggestions or pointers would be greatly appreciated.
Thanks,
Rob
|
| | 15 answers | Add comment |
|
| RSS - Whitespace is not allowed at this location. Mark R 12:14:13 |
| | Trying to create a page like popurls displaying rss feeds from music sites only im trying with one to start from NME.com and the output errors with the message "Whitespace is not allowed at this location."
anyone help?
DEMO: http://mngr.co.uk/rss1.asp
Code: <%@ Language="VBScript" %> <% Option Explicit %> <% Response.Charset = "UTF-8" %> <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ASP 101's MegaTokyo RSS Feed Reader</title> </head> <body>
<% If DateDiff("h", Application("MegaTokyoUpdated"), Now()) >= 2 _ Or Request.QueryString("force") <> "" Then
Dim objXML Dim objItemList Dim objItem Dim strHTML Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") objXML.async = False
objXML.setProperty "ServerHTTPRequest", True objXML.Load("http://nme.com/rss/news.xml") 'objXML.Load(Server.MapPath("megatokyo.xml"))
If objXML.parseError.errorCode <> 0 Then Response.Write "<pre>" & vbCrLf Response.Write "<strong>Error:</strong> " & objXML.parseError.reason Response.Write "<strong>Line:</strong> " & objXML.parseError.line & vbCrLf Response.Write "<strong>Text:</strong> " _ & Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf Response.Write "</pre>" & vbCrLf End If
Set objItemList = objXML.getElementsByTagName("item") Set objXML = Nothing
For Each objItem In objItemList ' MegaTokyo Feed childNodes: 0=title, 1=link, 2=description strHTML = strHTML & "<p>" & vbCrLf strHTML = strHTML & "<a href=""" & objItem.childNodes(1).text & """>" strHTML = strHTML & "<strong><em>" & objItem.childNodes(0).text strHTML = strHTML & "</em></strong></a><br />" & vbCrLf strHTML = strHTML & Replace(objItem.childNodes(2).text, "<br>", "<br />") & vbCrLf strHTML = strHTML & "</p>" & vbCrLf Next
Set objItemList = Nothing
Application.Lock Application("MegaTokyoContent") = strHTML Application("MegaTokyoUpdated") = Now() Application.UnLock End If %>
<%= Application("MegaTokyoContent") %> <!--<%= Application("MegaTokyoUpdated") %>-->
</body> </html>
|
| | 1 answer | Add comment |
Wednesday, 14 May 2008
|
| Text in ASP Scripts Hidden From Windows Search Perrinwolf 21:34:02 |
| | Not sure where to post this...
Found some interesting behavior in Windows Search (Start => Search => All files and folders => search for "A word or phrase in the file:"). This applies to XP and maybe other Windows flavors.
Procedure: 1. Create a simple text file named test.txt. 2. Open the text file in a text editor and add a simple test word such as "blah" (not quotes). 3. Save the text file. 4. Using Windows search, attempt to locate this new text file by searching for files containing the word "blah" (no quotes). Recommend limiting search to folder that contains the new text file and deselect search subfolders option. 5. The file should be found. 6. Change the file extension of the text file from .txt to .asp. 7. Redo the search. 8. The file should be found. 9. Reopen the text file (now named test.asp) in a text editor. 10. Change the string "blah" to "<% blah %>" (without quotes). [The brackets delineate script in asp files.] 11. Save the changes. 12 Redo the search. 13. The file is NOT found.
Interesting. There must be some security concern related to .asp files with embedded scripts relative to Windows Search. I wonder if there is a KB article or something about to this. I have not been able to find anything.
Can anyone shed any light on this behavior?
Does anyone know of a good tool to find files containing a specific string/pattern? Cygwin and some of the Unix tools works, but a GUI tool like Windows Search would be preferrable.
Thanks.
|
| | 3 answer | Add comment |
|
| Freeing Dynamic Arrays Headware 21:29:51 |
| | Do dynamic arrays declared using ReDim have to be freed? I assume that if it's an array of dynamically created objects (e.g. Scripting.Dictionary), each one of those objects will have to be set to Nothing in a for loop, but what about the array itself? Or what if the array is dynamic but it just consists of integers or strings, not dynamically allocated objects? Does it have to be set to Nothing?
Thanks, Dave
|
| | 4 answer | Add comment |
|
| Product activation code B. Nelsen 20:52:38 |
| | Hello, I have an ASP provider and an Access Database. I need to build a small webpage where the user can enter his "user id" and a "hardware code", and if the "user id" is correct (will be checked against the db which means the user id must exist) a function will generate a product activation code from his/ her "hardware code" and show it on the next page.
I think the database thing is not a problem, but I have not been able to create a simple function that is hacksafe and cannot be "downloaded". Could anybody give me a hint where I can find an example of such a function so that I can understand how I have to encapsulate the important parts so that nobody can see it?
Thank you very much!
|
| | 1 answer | Add comment |
Tuesday, 13 May 2008
|
| Create Window width new Session: solution MrZed 13:08:17 |
| | I run into this problem, and I read many places that these is not solvable.
I have one solution (workaround), not simple, a little trickier, limited, but possible and usable. My main problem was, that I have a complex site, and I have to make an archive site. Part of database is moved to the archive database (same structure), and the web should be the same (different users and rights stored in 2nd db) ... and I have to open it from the main site so, that both sides work simultaneously with different sessions ...
Solution: In the IIS you have to make Virtual Directories as application (example: test and test1, and because I am lazy, they local path is the same directory, they use the same files) Normally you call the site by the server/test address (so here http://server/test/test.asp) In the test asp if you click to open a new window ( javascript:window.open(...) ), you use the other IIS Virtual Directory, so there you open it as http://server/test1/test.asp And so in the new window you have the same test.asp running, but width a different session and sessionID
Test.asp is simple (called as http://server/test/test.asp ): <html> <head> <title>NewID test</title> </head> <body> <table><tr> <td>SessionID: <%=Session.SessionID%></td> </tr></table> <input type="button" onClick="newwindow()" value="new window">
<script language="javascript"> function newwindow() { window.open('/test1/test.asp','','toolbar=no'); </script>
</body> </html>
It is limited, because for every new session a new Virtual Directory is needed (like a working thread, but I only need +1 )
if someone has an easier solution, don't hesitate to share ;)
Zed
|
| | 1 answer | Add comment |
|
| Code Snippet Respository StreamLogic 06:24:52 |
| | All,
I have posted this question in various groups, so I apologize for any overlap.
I'd like to hear how other developers/architects keep track of old scripts, code snippets, relevant URLs, etc. I think most developers have an area where they keep reusable code they would like to use again. Year after year, we all develop things that can be reused in various projects.
Do you simply have a file system folder where you dump all of this information and then search on it? Do you have a custom database solution for this?
I'd like to hear how others are keeping track of many years worth of code snippets and scripts that they would like to reuse at some point.
Thanks, Curtis
|
| | 1 answer | Add comment |
|
| File Attributes with ASP in HTML EQNish 02:36:59 |
| | Not sure if this is the spot to ask but I need some help with a script I hijacked and put to my own use in an .ASP page
any ways I am using the FilesystemObjects to get a directory and file listing and generating a web page of that listing, but I need to filter out files with the SYSTEM tag, so it wont show files I dont want it to, Below is my full code for the ASP page, I have Commented where I need to change the listing structure, if anyone can help me filter these out I would be greatfull!!!
--- Begin code --- <%@LANGUAGE="VBSCRIPT"%> <% Option Explicit On Error Resume Next
' this section is optional - it just denies anonymous access If Request.ServerVariables("LOGON_USER")="" Then Response.Status = "401 Access Denied" End If
' declare variables Dim objFSO, objFolder Dim objCollection, objItem
Dim strPhysicalPath, strTitle, strServerName Dim strPath, strTemp Dim strName, strFile, strExt, strAttr Dim intSizeB, intSizeK, intAttr, dtmDate
' declare constants Const vbReadOnly = 1 Const vbHidden = 2 Const vbSystem = 4 Const vbVolume = 8 Const vbDirectory = 16 Const vbArchive = 32 Const vbAlias = 64 Const vbCompressed = 128
' don't cache the page Response.AddHeader "Pragma", "No-Cache" Response.CacheControl = "Private"
' get the current folder URL path strTemp = Mid(Request.ServerVariables("URL"),2) strPath = ""
Do While Instr(strTemp,"/") strPath = strPath & Left(strTemp,Instr(strTemp,"/")) strTemp = Mid(strTemp,Instr(strTemp,"/")+1) Loop
strPath = "/" & strPath
' build the page title strServerName = UCase(Request.ServerVariables("SERVER_NAME")) strTitle = "Contents of the " & strPath & " folder"
' create the file system objects strPhysicalPath = Server.MapPath(strPath) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strPhysicalPath) %>
<html>
<head> <meta http-equiv="Content-Language" content="en-us"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title></title> </head>
<body text="#C0C0C0" bgcolor="#000000">
<div align="center"> <table border="0" width="80%" id="table1"> <tr> <td align="center">Some web page Info here<p align="right"><b><font size="4">And here</font></b></td> </tr> </table> </div> <p align="center"> <img border="0" src="Folder.jpg"> </p>
<p align="center"><a href="../">Back</a></p>
<html> <body>
<div align="center"><center> <table width="100%" border="0" cellspacing="1" cellpadding="2">
<% '''''''''''''''''''''''''''''''''''''''' ' output the folder list ''''''''''''''''''''''''''''''''''''''''
Set objCollection = objFolder.SubFolders
For Each objItem in objCollection strName = objItem.Name strAttr = MakeAttr(objItem.Attributes) dtmDate = CDate(objItem.DateLastModified) %> <% Next %>
<% '''''''''''''''''''''''''''''''''''''''' ' output the file list ''''''''''''''''''''''''''''''''''''''''
Set objCollection = objFolder.Files
For Each objItem in objCollection strName = objItem.Name strFile = Server.HTMLEncode(Lcase(strName))
intSizeB = objItem.Size intSizeK = Int((intSizeB/1024) + .5) If intSizeK = 0 Then intSizeK = 1
strAttr = MakeAttr(objItem.Attributes) strName = Ucase(objItem.ShortName) If Instr(strName,".") Then strExt = Right(strName,Len(strName)-Instr(strName,".")) Else strExt = "" dtmDate = CDate(objItem.DateLastModified) %> ' This is where I am listing the Files in my webpage, but it lists all files, and I need to block the listing of system Files' <tr> <td align="left">A<%=strFile%></a></td> <td align="right"> </td> <td align="right"> <p align="left"><%=intSizeK%>K</td> </tr> <% Next %>
</table> </center></div>
</body> </html>
|
| | 1 answer | Add comment |
Monday, 12 May 2008
|
| asp datatable? Gold Herman 22:14:54 |
| | Hi i am using classical asp and have a problem that I hope someone can provide an elegant suggestion.
I have a recordset return rows looking like
Name,Stage,Amt joe,s1,20 joe,s3,30 sam,s2,10 sam,s3,20 sam,s4,30
and I like to constuct an html table looking like:
name s1 s2 s3 s4 s5 joe 20 0 30 0 0 sam 0 10 20 30 0
The stage is fixed s1 to s5 but not all names have all stages. Any hints how I can convert a recordset to this kind of table?
|
| | 1 answer | Add comment |
Sunday, 11 May 2008
|
| Having problem with CDOSYS. Body getting corrupted. Rohith KS 07:20:06 |
| | Hi i am using CDOSYS to send mails to the users from my application. Everything is working fine, mails are being sent to the user but in the mail the user receives, some extra characters such as '!' or spaces are coming between words. I tried defining a character set but still the problem exitss. Please help me with this.
|
| | 1 answer | Add comment |
Saturday, 10 May 2008
|
| tree menu from current directory Preet 22:01:38 |
| | i tried to find tutorials to build a working tree menu from contents of current folder but was unable to find any, neither did i find any working scrit to build on
can anyone suggest something
i am a newbie to javascript but i did manage to come up with something using filesystemobject
Set fso = Server.CreateObject("Scripting.FileSystemObject")
path = server.mappath("/") Set root = fso.GetFolder(Path) Set files = root.files Set folders = root.SubFolders response.write "<ul>" for each folder in folders response.write "<li>"+folder.name & "</li>" next for each file in files response.write "<li>"+file.name & "</li>" next response.write "</ul>"
-------------------------- http://www.eecpindia.com http://www.anchorfx.com http://forex.eecpindia.com
*** Sent via Developersdex http://www.developersdex.com ***
|
| | 4 answer | Add comment |
|
| prkUTApeddux Guest 01:22:48 |
| | zhU8E1 sd9fj41dkg0ckahr82y4
|
| | 1 answer | Add comment |
Friday, 9 May 2008
|
| Form posting Jezza 17:42:32 |
| | Hi I am new to ASP and would like to know whether this is the right forum to post to. If not please advise what would the best group to post to.
My problem is a mailing asp file when it loads up in the browser the page is blank. There are no error messages.
1) I fill in a form with my details - OK
2) This then passes me on to another form to fill in my payment details on a secure server. - OK
3) This is then supposed to pass the payment details on to an ASP script but when this ASP script is loaded, the page is blank where I'd be expecting a thank-you message or an error message saying I'd not completed the form correctly...any help gratefully received.
Regards Jeremy
script:
<% On Error resume Next Dim TBdy Dim MyCDO CR = Chr(13) Set MyCDO = Server.CreateObject("CDONTS.NewMail") If IsObject (MyCDO) Then MyCDO.From = "Joe Bloggs" MyCDO.To = "email@mydomain.co.uk" MyCDO.Subject = "***URGENT PAYMENT***" TBdy = &" Card Type : " &Request.Form("cardtype")&vbCrLf &vbCrLf &" Card Number : " &Request.Form("cardnumber")&vbCrLf &vbCrLf &" Card Type : " &Request.Form("cardtype")&vbCrLf &vbCrLf &" Card Number : " &Request.Form("cardnumber")&vbCrLf &vbCrLf &" Expiry Date : " &Request.Form("expirydate")&vbCrLf &vbCrLf &" Security Code : " &Request.Form("security")&vbCrLf &vbCrLf &" Card Holders Name : " &Request.Form("cardholdersname")&vbCrLf &vbCrLf &" Billing Address : " &Request.Form("billingaddress")&vbCrLf &vbCrLf &" Post Code : " &Request.Form("postcode")&vbCrLf &vbCrLf &" Country : " &Request.Form("country")&vbCrLf &vbCrLf &" Tel : " &Request.Form("tel")&vbCrLf &vbCrLf &" Fax : " &Request.Form("fax")&vbCrLf &vbCrLf TBdy = TBdy & "Thank you." MyCDO.Body = TBdy MyCDO.Importance = 2 MyCDO.value("Reply-to")=Request.Form("cardtype") MyCDO.Send Set MyCDO = nothing if Mailer.SendMail then Response.Redirect("http://www.mydomain.co.uk/test/thanks.htm") else
Response.Write("Please make sure you fill in all the required fields in the form. Click on the 'Back' button on your browser to try again please")
end if %>
|
| | 10 answers | Add comment |
|
| Could not load file or assembly System.Data.Entity Steve Wofford 02:48:24 |
| | I am recieving the following. This happens when I moved it from my development system to our production SBS 2003 w/ latest .net frameworks and service packs . I developed under XPSP2 and VS2008.
The error is pointing to the Web.Config of my application.
System.Data.Entity was missing from the server, but was on the dev system. I tried to add, but didnt help:
C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5
Server Error in '/' Application. --------------------------------------------------------------------------------
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file or assembly 'System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 47: <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> Line 48: <add assembly="System.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> Line 49: <add assembly="System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> Line 50: <add assembly="System.Data.Entity.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> Line 51: <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
Source File: D:\Inetpub\wwwroot\GoldmineIntegration\web.config Line: 49
Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' could not be loaded.
WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
|
| | 1 answer | Add comment |
Thursday, 8 May 2008
|
| Website cloaking shyPotter 19:02:26 |
| | Hi,
I have used this feature with IIS but I cannot remember now.
Basicly what I want is.
When Some one type mydomain.com it goes to mydomain.com and all further links are on other domain name and pages.
I want user to see all the time mydomain.com not the full url with querystring.
application is asp classic on IIS.
Kind Regards,
|
| | 1 answer | Add comment |
|