TEXT to HTML Conversion routine
| Code to the 1st page.<HTML> <HEAD> <TITLE></TITLE> <META name="description" content=""> <META name="keywords" content=""> </HEAD> <BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080> <h1> ASP-Text to Html</h1>
<form action = "mask.asp" method = "post" > <textarea wrap="virtual" name="Description" rows="12" cols="50"></textarea> <p> <input type="Submit" name="Next" value="Go" style="font-family: Arial; font-size: 7pt"> </p> </form> copyright © 1999 hostmaster@reviewnow.com
</BODY> </HTML> Code to the 2nd page<html> <Head> <Title> ASP - Text-to-Html </title> </head> <h1> ASP - Text-to-Html </h1>
<% 'Copyright 1999 William Mclaughlin ' Hostmaster@reviewnow.com 'this copyright notice Must stay with this code it is not to be given out without the permission of the owner Copyright = "Copyright © 1999 William Mclaughlin <br> <a href = mailto:""hostmaster@reviewnow.com"">hostmaster@reviewnow.com</a>"
%>
<% if len(request.form("Description")) > 1200 then response.write "<p>An error occurred while attempting to processing your submission.<br> Your submission has not been completed. <br> Please press the Back button on your browser, correct the error listed below, and re-submit the form.</p>" response.write "Error Information:<br>" response.write "The text limit on the description field is 1200 characters. You have exceeded this limit. " response.write "<form>" response.write "<input type='button' value='Retry' onclick=history.back()>" response.write "</form>" response.end End if If IsEmpty(request.form("Description")) or request.form("Description")="" then response.write "<p>An error occurred while attempting to processing your submission.<br> Your submission has not been completed. <br> Please press the Back button on your browser, correct the error listed below, and re-submit the form.</p>" response.write "Error Information:<br>" response.write "You must enter a Description." response.write "<form>" response.write "<input type='button' value='Retry' onclick=history.back()>" response.write "</form>" response.end Else Description = request.form("Description") End If %> <% if Request.form("Description") <> "" Then
%> <%
Dim Inputstring Dim filenum Dim HTTP Dim FTP Dim temp Dim Pos Dim Pos1 Dim Pos2 Dim endlength Dim tempchar Dim BeginningP BeginningP = False HTTP = "http://" FTP = "ftp://"
Inputstring = Description
Do While ((InStr(1, Inputstring, HTTP, 1) <> 0) Or (InStr(1, Inputstring, FTP, 1) <> 0)) Pos = 0 Pos1 = InStr(1, Inputstring, HTTP, 1) Pos2 = InStr(1, Inputstring, FTP, 1)
If Pos1 = 0 Then Pos = Pos2 ElseIf Pos2 = 0 Then Pos = Pos1 End If If Pos = 0 Then 'neither pos1 or pos2 are 0 If Pos1 < Pos2 Then Pos = Pos1 Else Pos = Pos2 End If End If response.write "<P>" AddP Mid(Inputstring, 1, Pos - 1), filenum ' Response.write Mid(Inputstring, 1, Pos - 1) Response.write "<a href = " & Chr(34) Inputstring = Mid(Inputstring, Pos, Len(Inputstring)) spacefound = False temp = "" x = 0 endlength = Len(Inputstring) Do x = x + 1 tempchar = Left(Inputstring, 1) If tempchar <> " " Then If tempchar = vbCr Then spacefound = True Response.write Chr(34) & ">" & temp & "</a></p>" 'Temp taken out and Response.write "<P>" Else temp = temp & tempchar Response.write tempchar Inputstring = Right(Inputstring, Len(Inputstring) - 1) End If Else spacefound = True Response.write Chr(34) & ">" & temp & "</a></P>" Response.write "<P>" End If Loop Until (x = endlength) Or (spacefound) If x = endlength Then Response.write Chr(34) & ">" & temp & "</a></P>" End If
Loop AddP Inputstring ,filenum Response.write "</P>"
Public Sub AddP(tempstring,filenumber) Dim x Dim tempchar For x = 1 To Len(tempstring) tempchar = Mid(tempstring, x, 1) If tempchar = vbCr Then Response.write "</P>" Response.write tempchar Response.write "<P>" Else Response.write tempchar End If Next
End Sub %> <% Else %> Please ReEnter your information <% End if %> <%= Copyright %> </body> </html>
|
|
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More ASP Code Articles More By aspfree developerWorks - FREE Tools! | David Barnes, Lead Evangelist for IBM Emerging Internet Technologies will discuss aspects of Web 2.0 that bring value to corporations, academia, and government. He'll also discuss IBM's vision around Web 2.0, including the importance of remixability and consumability. The discussion will culminate with examples of various IBM Software Group solutions you can use to get ahead of the Web 2.0 adoption curve. FREE! Go There Now!
| | | | Join us for this on demand webcast to learn about developing complex systems more quickly and efficiently. We'll cover market drivers for developing, governing and reusing systems software assets and how you can develop system software assets with Rational Asset Manager. FREE! Go There Now!
| | | | WebSphere Process Server delivers a unique integration framework that simplifies existing IT resources. Often, as IT assets grow to support business demand, so too does their complexity and manageability. In this webcast, we’ll discuss how WebSphere Process Server helps deliver an SOA infrastructure that provides a common model to orchestrate, mediate, connect, map, and execute the underlying IT functions. Discover how WebSphere Process Server simplifies integration of business processes by leveraging existing IT assets as reusable services without the complexities of traditional integration methodologies. FREE! Go There Now!
| | | | Download the Rational Application Developer (RAD) v7.5 open beta code and start developing applications for the JEE5 standard which features EJB3.0, JPA, JSF 1.2, JSP 2.1 and Servlet 2.5 standards. When you use this beta you will see how you can increase developer productivity for already existing applications with improved support for refactoring, as well as adding new features to existing applications. In addition, the beta provides tooling for JD Edwards, Oracle, SAP, Siebel and PeopleSoft to improve the developer productivity with these enterprise systems. FREE! Go There Now!
| | | | Download a free trial version of IBM DB2 9.5 for Linux, UNIX, and Windows. DB2 9 is the result of a five-year development project that transformed traditional (static) database technology into an interactive data server that merges the high performance and ease of use of DB2 with the self-describing benefits of XML. FREE! Go There Now!
| | | | Asset Reuse is a key strategy for companies looking to create innovative solutions to solve complex software development problems. Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. Listen to this webcast, to learn about strategies and tools that you can leverage for a successful project, including Rational Asset Manager, Rational Software Architect and WebSphere Service Registry and Repository. FREE! Go There Now!
| | | | XML has become a common way of storing business data as flat files and many data server vendors including IBM have provided ways to store this data within relational database systems. Increasingly collections of XML files are accessed like databases using an xQuery and other XML standard mechanisms. Businesses find the need to combine the traditional tabular structured data with XML formatted data. In this webcast, you’ll learn about IBM’s WebSphere Federation Server technology, which provides users with the ability to integrate these two data formats. FREE! Go There Now!
| | | | This whitepaper provides areas to consider when evaluating any software configuration management solution. It addresses how the IBM solutions (Rational ClearCase and Rational ClearQuest) meet the needs and requirements of both project leaders and developers to provide successful Software Change and Configuration Management. FREE! Go There Now!
| | | | In this webcast, IBM Rational will discuss the importance of Web application security and will share techniques and best practices to introduce application security testing into current QA processes including: understanding common security vulnerabilities and techniques to integrate security testing with defect tracking and remediation systems in an effort to safeguard sensitive online information. FREE! Go There Now!
| | | | IBM Lotus Notes 8 provides a wide range of developers the ability to provide customized, integrated user interfaces via composite applications and via custom sidebar and toolbar plug-ins. This webcast provides you with tips and techniques to use with out-of-the-box capabilities of Lotus Notes 8, and survey how you can share useful components within your own company and within a larger community. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |