I want to be able to write an HTML script
that allows and tests if a URL is valid...
Like..I have an entry form -
and you type in the URL.
And below there's either a SUBMIT and RESET button.
I can't seem to get my thing to work.
When I type in the URL on the line, I would like to code to either
say - Link/URL is valid - and then goes to the page
and if it's not a proper url- i would get a message saying -
Link/URL invalid, please try again, or like page will refresh in 3 seconds.
It's been tough to do so.It's almost like page validation in some way, but I just want to get the form thing to just goto whatver webpage is typed in.
--------------------------------
Part1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<TITLE></TITLE>
<style>
body, input { font-family:Tahoma; font-size:10pt; }
</style>
</HEAD>
<BODY>
<P><IMG border="0" src="image/logo-top.gif" width="301" height="55"></P>
<form action="htmlsubmit.jsp" method="post">
Please enter URL of web page:
<input type="text" name="URL" /></br>
<p><input type="submit" name="Submit" id="Submit" value="Submit"> <input type="reset" name="Reset" id="Reset" value="Reset"> </p>
</form>
</BODY>
</HTML>
---------------------------------------
Sep part 2-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
%>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="IBM WebSphere Studio">
<TITLE>HTMLERROR.jsp</TITLE>
</HEAD>
<BODY>
<%@ page errorPage="mainerror.jsp" %>
<html>
<head>
<style>
body, p { font-family:Tahoma; font-size:10pt; }
</style>
<%-- Form Handler Code --%>
<%
int URL;
URL = Integer.parseInt(request.getParameter("URL"));
%>
<%-- Displaying URL of Webpage --%>
<p>The URL you have entered is : <%= URL %></p>
<if condition>
<!-- RXML CODE -->
<if text='www'>
<p><b><font color=navy><font size = 4>The URL of the web page is valid.</b></p></font>
<elseif condition>
<p><font color=red><font size = 5>The URL of the web page is Invalid.<br></font></font></p>
</else>
</if>
<%@ page isErrorPage="true" import="java.io.*" %>
<html>
<head>
<title></title>
<style>
body, p { font-family:Tahoma; font-size:10pt; padding-left:30; }
pre { font-size:10pt; }
</style>
</head>
<body>
<%-- Exception Handler --%>
<font color="red">
<%= exception.toString() %><br>
</font>
<%
out.println("<!--");
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
exception.printStackTrace(pw);
out.print(sw);
sw.close();
pw.close();
out.println("-->");
%>
<p><a href="htmlopenpage.html">Back</a>.</p>
</BODY>
</HTML>