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! | The IBM DB2 Deep Compression ROI tool is designed for DBA’s and IT management personnel to perform a clinical analysis of the cost savings gained from the Storage Optimization feature of DB2 9 for Linux, UNIX and Windows. The feature, also known as Deep Compression, compresses data that lies within a database by up to 80% at times. FREE! Go There Now!
| | | | Learn how you can extend modern application lifecycle management to IBM System z through the IBM Rational Software Delivery Platform (SDP). The Did you say mainframe? e-kit includes podcasts, webcasts, tutorials, white and red papers, demos, and articles designed to help ease the challenges of modernizing your enterprise. This complimentary kit for mainframe developers is a practical, how-to guide for making the most of an existing development environment, including the skills and infrastructure already in place at an established enterprise. FREE! Go There Now!
| | | | As organizations integrate software into every aspect of business, they are constantly pressured to deliver faster, better, and cheaper results. Unfortunately, a “dis-integrated” software delivery approach reduces returns while increasing costs. This IBM Rational White Paper shows how Integrated Requirements Management aligns organizations around maximizing value and keeping pace with change. FREE! Go There Now!
| | | | Join this webcast to discover the key requirements for successful change and release management. Learn how to extend your .NET environment to improve productivity and collaboration, and address core problems afflicting team development. In this webcast, we’ll review typical challenges faced by customers and how to resolve them with the IBM Rational Change and Release Management solution, including Rational ClearCase, Rational ClearQuest and Rational Build Forge. Replay is available for 9 months. FREE! Go There Now!
| | | | Visit IBM developerWorks to try the IBM SOA Sandbox for connectivity. The SOA Sandbox for connectivity provides a trial environment with the tooling and components to help you explore how to effectively connect your infrastructure and integrate all of the people, processes and information in your company. Use the hosted sandbox to explore SOA techniques that streamline connecting existing IT assets together, as well as learn how to connect them to new business logic. FREE! Go There Now!
| | | | Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs). 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!
| | | | As businesses grow increasingly dependent upon Web applications to provide services to customers, employees and partners, these complex applications become more difficult to secure. Although traditional security solutions protect Internet infrastructure layers, they do not guard against HTTP and HTML attacks. Many organizations that conduct security testing still deploy applications that allow attackers to manipulate their logic and wreak havoc on their business. To mitigate this risk, development and delivery teams must address Web application security throughout the lifecycle, addressing the many layers detailed in this paper. 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!
| | | | Learn how to implement a build management system that uses and extends your existing automation technologies. This tutorial shows, step-by-step, how to install and configure IBM Rational Build Forge to manage builds for Jakarta Tomcat from source code. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |