Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » Need help: Html script- url linking


Need help: Html script- url linking

Reply
  #1 (permalink)  
Old 09-20-05, 10:44 AM
nyjumpman23 nyjumpman23 is offline
New Member
 
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Need help: Html script- url linking

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"> &nbsp; <input type="reset" name="Reset" id="Reset" value="Reset"> &nbsp;</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>
Reply With Quote
  #2 (permalink)  
Old 09-20-05, 10:52 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
This may soon appear in the Scripts Request forum.
Reply With Quote
  #3 (permalink)  
Old 09-20-05, 12:39 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by nyjumpman23
I want to be able to write an HTML script
that allows and tests if a URL is valid...
You could code this in PHP in about an hour or so. Use cURL to retreive the page and test for the server response, then forward the user if the link is valid.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #4 (permalink)  
Old 09-20-05, 03:59 PM
Brandon@Cstone Brandon@Cstone is offline
Newbie Coder
 
Join Date: Sep 2005
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
this is obviously not a HTML question, but even using javascript you can test to make sure that there is a http:// or a .com or a www. or whatever you want to check. If you want to make sure that the website is up, a PHP script like End User said, can be written (or may already be written else where on the web)
Reply With Quote
  #5 (permalink)  
Old 09-28-05, 03:34 PM
nyjumpman23 nyjumpman23 is offline
New Member
 
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Hm...well

It kinda has to be written in all JAVA
or HTML

it's buggin the crap outta me man.
Reply With Quote
  #6 (permalink)  
Old 09-28-05, 09:19 PM
karlcore karlcore is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nyjumpman23
It kinda has to be written in all JAVA
or HTML

it's buggin the crap outta me man.
It should be buggin the crap outta ya, man. HTML is a markup language. There is no such thing as an HTML script.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
html tutoral thefrtman HTML/XHTML/XML 5 04-27-09 10:25 AM
Raffle/Lottery Script (Very profitable!), Coded it myself. Voltaire General Advertisements 6 03-16-09 07:15 AM
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
iframe linking not working under url masking willNoClue HTML/XHTML/XML 1 08-02-04 10:34 AM
Parse html script [PHP+Mysql] NightRave Script Requests 0 03-23-04 12:02 PM


All times are GMT -5. The time now is 08:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.