Function to remove text between html tags


can someone help me create a function to remove text between html tags (so that all I have left is the html tag itself



Posted On: Friday 26th of October 2012 01:02:05 AM Total Views:  334
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




Writing many parameters to a function - Page 2

Originally Posted by sebs Man, just use an array, don't need to get fancy: Writing many parameters to a function yup, have to second that in this case. personally, I would have choose the Class way as it's elegant and better practice, but it's only because I'm very familiar with the concept.
VIEWS ON THIS POST

177

Posted on:

Friday 26th October 2012
View Replies!

Data by ID and Getdate function

I am trying to return data by date but I also need to return data by date "and" by ID. I've queried various select statements but always get only one days worth of data and the date is repeated many times. I only want to return data for today only but with ID as the other variable. For example I want only the shows for today by date and by ID. ID of course being the key in the DB. Below I will show you a code block followed by a text version of what it looks like in the browser when tested. Code: Output: ID Unit Subject Title Long_Summary Body_Text Related_Events Air_Date AudioLink (Reading across the screen from left to right) 1234 WK1 Subject Title a summary some body text Event text 4/13/2007 wkdy20070413-a.rm Here is the URL used for testing: http://Test Server IP/test/defaultweekday2.asp I need to be able to append to this URL an ID number so that not only do I get content by Air_Date but also by ID. http://Test Server IP/test/defaultweekday2.aspID=1234 Units can be listed as: WK1, WK2, TB and TC How to do this
VIEWS ON THIS POST

118

Posted on:

Friday 26th October 2012
View Replies!

Valid Email Address function not working Correctly

i have a function that checks to see if an email address is valid or not. However even when i put in a valid email address such as a hotmail account, it comes back and says that the email address is not valid. Am i using it right I have tried various ways without any luck. Code: Function ValidEmailAddress(sEmail) RegExpTest = false Dim regEx, retVal Set regEx = New RegExp regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$" regEx.IgnoreCase = true retVal = regEx.Test(sEmail) If not retVal Then exit function End If RegExpTest = true End Function '''''''''VERIFY IF VALID EMAIL BEFORE SENDING MAIL Code: if ValidEmailAddress(strEmail) = FALSE then if trim(InvalidEmail) = "" then InvalidEmail = strEmail else InvalidEmail = InvalidEmail & "$" & strEmail end if else call SendEmail(strName,strEmail) end if
VIEWS ON THIS POST

188

Posted on:

Friday 26th October 2012
View Replies!

Calling a sql 2005 user defined function from ASP 3.0?

Hi Guys, I've created a function in sql 2005 that checks for the existence of a table and returns 1 if it exists and 0 if it doesn't. Along the lines of "FUNCTION [dbo].[fCheckTableExists] (@sTableName NVARCHAR (40)) RETURNS INTEGER" I'm fairly new to ASP, and was wondering how i would call this function from my ASP script. I've tried using Function fCheckSQLHoldingTableExists (sDNSConn, sTableName) Dim oCmd Dim sSqlStatement Dim iResult Set oCmd = Server.CreateObject ("ADODB.Command") With oCmd .ActiveConnection = sDNSConn .CommandText = "dbo.fCheckTableExists" .CommandType = adCmdStoredProc .Parameters.Append oCmd.CreateParameter ("@sTableName",adVarChar,adParamInput ,40, sTableName) '//won't accept this parameter - Parameters.Append oCmd.CreateParameter ("@return",adInteger,adParamOutput, , 0) End With iResult = oCmd.Execute If iResult = 0 Then fCheckSqlHoldingTableExists = FALSE Else fCheckSqlHoldingTableExists = TRUE End If oCmd.Close Set oCmd = Nothing End Function However, this doesn't work. I keep getting - "Microsoft VBScript runtime error '800a01c2' Wrong number of arguments or invalid property assignment /processpl.asp, line 77 " The error indicates theres a problem assigning the result back to iResult on the line "iResult = oCmd.Execute". I'm at a loss though, can you help Paul
VIEWS ON THIS POST

207

Posted on:

Friday 26th October 2012
View Replies!

Do Until not functioning properly

I have some code as indicated below that is causing issues. The basic gist of this is that it makes downloading of podcast's available (currently) all the time. However I need it to make them available if and only if the date is the day after the podcast is recorded. Currently the site is making them available the day before they're actually ready. How can I code this so that the asp page knows that the podcast should be available only on the day it is actually ready CODE SAMPLE: Code: This was designed by another developer and I'm trying to reverse engineer it, so I'm not an asp guru by trade. Just trying to help them out.
VIEWS ON THIS POST

114

Posted on:

Friday 26th October 2012
View Replies!

AND counter = function not working right

. We have a webpage that displays show information based on which day of the month it is. Currently it will show information from a week ago but not this last Dec 5th like it should have. The SQL database does show the information for both Nov 28th and Dec 5th, but in Firefox and IE it will only show Nov 28th posting. I will provide content reference in here also. CONTENT REFERENCE One Item Store / Smart Cars / Big-Box Swindle Most retailers pride themselves on selection. Not Woot.com. Go to the online store and you will find precisely one item and often it will be sold out. But it's a different item every day and usually at a deep discount. We meet one of the people behind Woot who tells us why they run it the way they do. Plus, you may have seen the Smart Car puttering around town. It looks like a compact car that had the back end taken off. We meet a local dealer who sells these and other unique vehicles and we take a test drive. Plus, the author of Big-Box Swindle talks about the non-retail cost of mega retailers and what it means to independent businesses. The content above is dated Nov 28th. It should be showing Dec 5ths content. The code below is in the ASP page which shows what the user sees online. I want to add another AND statement so that it will account for any day of the month and show the current days content. What is the best way to do this Can I just add another AND counter statement Here is the code section I need help tweaking. Code: hightlight="ASP"/highlight
VIEWS ON THIS POST

156

Posted on:

Friday 26th October 2012
View Replies!

Replace function

I was wondering if any one could help me, I'm try to insert this info in to my database o'farrel and I'm using this Code: mail1 = replace(Request.Form("email1"),"'","''") when it inserts the information it looks like this for the email link O'fo@site.com
VIEWS ON THIS POST

112

Posted on:

Friday 26th October 2012
View Replies!

REALLY quick help. Forgot a function

I used to have it, but then I lost it. I need to return every value of every variable set in my ASP script. Anyone
VIEWS ON THIS POST

314

Posted on:

Friday 26th October 2012
View Replies!

How to add a   with every call to function?

I have a function getSubordinates(managerID) Now with every call to this function, I want to indent the employee by 2   Code: Dim indent indent = "    " How can do this
VIEWS ON THIS POST

212

Posted on:

Friday 26th October 2012
View Replies!

Using split function.

Hi Guys, I have this function that reads from a text file on another server. It then splits the text file line by line. Now I want to split these lines into words based on ; delimiter and store in an array. Please cany anybody help me. Here is the code
VIEWS ON THIS POST

218

Posted on:

Friday 26th October 2012
View Replies!

Calling functions

im supposed to create an asp program to call all these functions and write a text file with the data... can anyone help ): Code: 1 Then sRetVal = sRetVal & Month(dGMTTime) Else sRetVal = sRetVal & "0" & Month(dGMTTime) End If If Len(Day(dGMTTime)) > 1 Then sRetVal = sRetVal & Day(dGMTTime) Else sRetVal = sRetVal & "0" & Day(dGMTTime) End If sRetVal = sRetVal & "T" If Len(Hour(dGMTTime)) > 1 Then sRetVal = sRetVal & Hour(dGMTTime) Else sRetVal = sRetVal & "0" & Hour(dGMTTime) End If If Len(Minute(dGMTTime)) > 1 Then sRetVal = sRetVal & Minute(dGMTTime) Else sRetVal = sRetVal & "0" & Minute(dGMTTime) End If If Len(Second(dGMTTime)) > 1 Then sRetVal = sRetVal & Second(dGMTTime) Else sRetVal = sRetVal & "0" & Second(dGMTTime) End If sRetVal = sRetVal & "Z" adjustTime= sRetVal End Function '===================================================================== ' Convert the time from HH:MM:SS to format HHMMSS, or return ' "Error" when failed to convert the time format '===================================================================== Function checkTime ( sTime) Dim sHour, sMinute, sSecond, nSeperator1, nSeperator2 If (Len(sTime) < 5) Or (Len(sTime) > 8) Then checkDate = "Error" Exit Function End If nSeperator1 = InStr(1, sTime, ":", vbTextCompare) If (nSeperator1 < 2) Or (nSeperator1 > 3) Then checkTime = "Error" Exit Function End If nSeperator2 = InStr(nSeperator1+1, sTime, ":", vbTextCompare) If (nSeperator2 < 4) Or (nSeperator2 > 6) Then checkTime = "Error" Exit Function End If sHour = Mid(sTime, 1, nSeperator1 - 1) If ( sHour < 0 ) Or ( sHour > 23) Then checkTime = "Error" Exit Function Else If Len(sHour) < 2 Then sHour = "0" & sHour End If End If sMinute = Mid(sTime, nSeperator1 + 1, nSeperator2 - nSeperator1 - 1) If ( sMinute < 0 ) Or ( sMinute > 59) Then checkTime = "Error" Exit Function Else If Len(sMinute) < 2 Then sMinute = "0" & sMinute End If End If sSecond = Mid(sTime, nSeperator2 + 1) If ( sSecond < 0 ) Or ( sSecond > 59) Then checkTime = "Error" Exit Function Else If Len(sSecond) < 2 Then sSecond = "0" & sSecond End If End If checkTime = sHour & sMinute & sSecond 'response.write sHour & sMinute & sSecond & "" End Function '===================================================================== 'Generate the .ics file and return the file name, or return a err code 'Input Date format: DD-MM-YYYY 'Input Time format: HH:MM:SS 'Error Code: 101 - Start Date format error ' 102 - Start Time format error ' 103 - End Date format error ' 104 - End Time format error '===================================================================== Function genAttachemnt(sID, sStDate, sStTime, sEnDate, sEnTime, sTitle, sLocation, bPrvtFlag, bDayFlag, sCateg, sPath) On error resume next Dim oFSO, oICSFileMap, oICSTextFile Dim sTempStamp, dTempDate Set oFSO = Server.CreateObject("Scripting.FileSystemObject") oICSFileMap = Server.MapPath(spath & sID & ".ics") If oFSO.FileExists(oICSFileMap) = True Then '\t\t\t\t\t\t oFSO.DeleteFile (oICSFileMap) End If Set oICSTextFile = oFSO.CreateTextFile(oICSFileMap,true, False) '\t\t oICSTextFile.Writeline "BEGIN:VCALENDAR" oICSTextFile.Writeline "PRODID:-//justlogin.com//eLeave Module//EN" oICSTextFile.Writeline "VERSION:2.0" oICSTextFile.Writeline "METHOD:PUBLISH" oICSTextFile.Writeline "BEGIN:VEVENT" '2006-8-4 23:30:16 sTempStamp = checkDate ( sStDate ) If sTempStamp = "Error" Then genAttachemnt = "101" Exit Function End If sStDate = sTempStamp sTempStamp = checkDate ( sEnDate ) If sTempStamp = "Error" Then genAttachemnt = "103" Exit Function End If sEnDate = sTempStamp If bDayFlag Then oICSTextFile.Writeline "DTSTART;VALUE=DATE:" & sStDate oICSTextFile.Writeline "DTEND;VALUE=DATE:" & sEnDate Else sTempStamp = checkTime ( sStTime ) If sTempStamp = "Error" Then genAttachemnt = "102" Exit Function End If sStTime = sTempStamp sTempStamp = checkTime ( sEnTime ) If sTempStamp = "Error" Then genAttachemnt = "104" Exit Function End If sEnTime = sTempStamp dTempDate=adjustTime(sStDate, sStTime) oICSTextFile.Writeline "DTSTART:" & dTempDate dTempDate=adjustTime(sEnDate, sEnTime) oICSTextFile.Writeline "DTEND:" & dTempDate End If sTempStamp = getTimeStamp() oICSTextFile.Writeline "DTSTAMP:" & sTempStamp oICSTextFile.Writeline "TRANSP:OPAQUE" oICSTextFile.Writeline "SEQUENCE:0" oICSTextFile.Writeline "UID:" & sID oICSTextFile.Writeline "SUMMARY:" & sTitle oICSTextFile.Writeline "LOCATION:" & sLocation If bPrvtFlag = True Then oICSTextFile.Writeline "CLASS:PRIVATE" End If oICSTextFile.Writeline "CATEGORIES:" & sCateg oICSTextFile.Writeline "END:VEVENT" oICSTextFile.Writeline "END:VCALENDAR" oICSTextFile.Close() Set oICSTextFile = Nothing Set oFSO = Nothing genAttachemnt = spath & sID & ".ics" End Function %>
VIEWS ON THIS POST

184

Posted on:

Friday 26th October 2012
View Replies!

Date function

hi, i have a to find out if this can be done in a easier way i am trying to add 5 years to the current date so today is 08/11/2006 if i add 5 years i want it to be 08/11/2011 so what i did was from current date get the mm/dd/yyyy seperately then added 5 to the yyyy and then did a concat and got 08/11/2011 is there a easier way of adding years to the current date
VIEWS ON THIS POST

189

Posted on:

Friday 26th October 2012
View Replies!

Delete button doesnt function

Originally, the page was setup as a calendar done by someone else. Now, I am using that same code for the calendar to use as a menu of the day for the intranet not internet. In the admin page where the admin can edit the menu list has only one cell in the table. This time I will need to create 3 cells, one for breakfast, lunch and dinner. However, when I reproduced the cell, it only able to add, edit, and jump to different month. But it could not delete what was added or edited. Below is the code with 2 cells for testing purpose before adding another cell for dinner. Sorry for putting long code in but figured that it would be better to have all in one. Code:    to       to 
VIEWS ON THIS POST

219

Posted on:

Friday 26th October 2012
View Replies!

PageCount not functioning

Can anybody help with this coding, it is an image gallery offered up as free software, the only thing is, when more than 9 pictures are in one category it creates a new page with a link at the bottom i.e Page (1,2,3....). When clicking on the link for a particular page the gallery category is requested along with the page id, i.e. gallery_id=3&page=1 but the page returned when 'page=' is present in the menu bar is always the last page in the category. If this does not make sense, please see here The code for the page is; Code: 1 Then getPlural = str & "s" Else getPlural = str End If End Function Set rs = Server.CreateObject("ADODB.RecordSet") sql = "SELECT g.gallery_id, g.gallery_title, COUNT(i.image_id) AS imgCount FROM galleries g, images i WHERE " & _ "i.gallery_id = g.gallery_id GROUP BY g.gallery_id, g.gallery_title;" rs.Open(sql), conn, 3 If rs.EOF And rs.BOF Then dispError("No records returned. Please try again") End If %> Galleries:  
VIEWS ON THIS POST

123

Posted on:

Friday 26th October 2012
View Replies!

The function expects a string as input??

I am trying to insert a value from the text box into the DB.A very simple code of inserting a record in the DB. Following is the code: New Page 1
VIEWS ON THIS POST

224

Posted on:

Friday 26th October 2012
View Replies!

JS function defined by ASP not executed - Page 2

cheers Nico, feel free to stick around and make yourself home.
VIEWS ON THIS POST

365

Posted on:

Friday 26th October 2012
View Replies!

Delete button doesnt function - Page 2

Replace this Code: SQL = SQL & SafeDate(Request.Form("txtEndTime")) & ", '" SQL = SQL & SafeQuote(Request.Form("BLD")) & ", '" SQL = SQL & SafeQuote(Request.Form("txtDetails")) & "' );" With This Code: SQL = SQL & SafeDate(Request.Form("txtEndTime")) & ", " SQL = SQL & SafeQuote(Request.Form("BLD")) & ", " SQL = SQL & SafeQuote(Request.Form("txtDetails")) & " );"
VIEWS ON THIS POST

263

Posted on:

Friday 26th October 2012
View Replies!

Search function cannot work

Hi all, below are da codes, but it cant work, got error den... Dim strInputSearch AS string Dim strCon AS Object Dim adoCon AS string Dim strSQL AS string Dim rsSearch AS ADODB.Recordset Dim conn AS String searchresult Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2. /ASP/searchresult.asp, line 28 Can anyone tell me da solution\t wat's da error\t
VIEWS ON THIS POST

418

Posted on:

Friday 26th October 2012
View Replies!

Writing a connection to db function

, I want to make a function that will connect to db when I call it and then I can use the connection it opened. It's need to be a sub-procedure or a function Is it good Code:
VIEWS ON THIS POST

207

Posted on:

Friday 26th October 2012
View Replies!

Error on function ???

Microsoft VBScript compilation error '800a0414' Cannot use parentheses when calling a Sub /includes/adotest.asp, line 16 SaveTextDate(StrUrl,Chopper, ascii) -----------------------------------^ is the error i get, and my mind is blank due 2 working 2 long but help much appreciated, i am just messing but would like to save a binaryfile with ADO. Code: Chopper ="hello there!" StrUrl = "D:\domains\shopocart.com\wwwroot\testing.asp" SaveTextData(StrUrl,Chopper, ascii) Function SaveTextData(FileName, Text, CharSet) Const adTypeText = 2 Const adSaveCreateOverWrite = 2 no need to include the whole function, but it is a function not a sub many
VIEWS ON THIS POST

188

Posted on:

Friday 26th October 2012
View Replies!