| 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>
|