%@LANGUAGE=VBScript%> <%option explicit response.buffer = true response.cachecontrol = "private" response.expires = -1 '--- We don't want this to be cached anywhere '---------------------------------------------------------------------------------------- '- ASP PrinterFriendly application - Version 1.0 - 10 June 2005 '- Copyright © 2005 - Livio Siri (http://www.livio.net) - All Rights Reserved. '---------------------------------------------------------------------------------------- '--- print.asp - Make a link to this page from your page. '--- (ex. Printer friendly) '--- ASSUMES THAT YOUR PAGE HAS PRINTABLE CONTENT WITHIN TWO COMMENTS '--- '--- '--- Needs MSXML 3.0 and VBScript version 5 or above installed '---------------------------------------------------------------------------------------- if request.servervariables("HTTP_REFERER") <> "" then '--- if this didn't come from anywhere, ignore all. '--- Define variables dim strContent, xml_http dim objRegExp, strTitle , strBody, strAns dim content_start, content_end, title_start, title_end dim strThisDir '--- Perform the HTTP "get" method via the XMLHTTP object to retrieve the page to be printed '--- Using the XMLHTTP object instead of something like FSO means that the ASP page '--- is actually executed and not just 'read' as a stream of characters. set xml_http = server.createobject("Microsoft.XMLHTTP") xml_http.open "get", request.servervariables("HTTP_REFERER"), false xml_http.Send strContent = xml_http.responseText set xml_http = nothing '--- get the Referer path for display purpose strThisDir = mid(request.servervariables ("HTTP_REFERER"),1,inStrRev(request.servervariables ("HTTP_REFERER"),"/") ) strBody = strContent '--- strBody contains now the whole HTML page if len(strBody) > 0 then '--- get the page Title to be printed positioning references title_start = instr(lcase(strBody), "
| Printvenlig Version af "<%=request.servervariables("HTTP_REFERER")%>" Siden: <%=strTitle%> |
|
|
| <%=strbody%> |
|
<%session.lcid = 1040%>Denne side udskrives fra Bækkelund Gårdbutik, Tranemosevej 8, Ruds Vedby - tlf 5826 1514 - på www.baekkelundgaardbutik.dk <%=date%>
|