PDA

View Full Version : help...Jump to a new page


Tom2002
09-05-2002, 08:00 AM
Ok guys,
I am new to HTML and I need some help. I would like to have a web page forward a user to a new web page without them clicking on anything.

Can anyone help me on this matter.

Thanks,
Tommy
tlafleur@usa.net

hairynugs6382
09-05-2002, 08:25 AM
here this should help u out it will redirect the user upon so many seconds after the page loads, you can fool around with it. hope it works out! place this below your body tag:

place script in body of page
===================================================
<form name="redirect">
<center>
<font face="Arial">
<b>You will be redirected to the script in<br>
<br>
<form><input type="text" size="3" name="redirect2">
</form>seconds</b>
</font>
</center>
<script><!--
/*Copyright 2000 Stephen Shellard (c)*/
//change below target URL to your own

var targetURL="http://www.a1javascripts.com"

//change the second to start counting down from

var countdownfrom=10

var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script>

Tom2002
09-05-2002, 03:16 PM
For some reason it did not work. I pasted the code so you can look at it.


<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<body>

&lt;form name="redirect"&gt;
&lt;center&gt;
&lt;font face="Arial"&gt;
&lt;b&gt;You will be redirected to the script in&lt;br&gt;
&lt;br&gt;
&lt;form&gt;&lt;input type="text" size="3" name="redirect2"&gt;
&lt;/form&gt;seconds&lt;/b&gt;
&lt;/font&gt;
&lt;/center&gt;
&lt;script&gt;&lt;!--
/*Copyright 2000 Stephen Shellard (c)*/
//change below target URL to your own

var targetURL="http://www.a1javascripts.com"

//change the second to start counting down from

var countdownfrom=10

var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//--&gt;
&lt;/script&gt;

</body>

</html>

Galdo
09-05-2002, 04:00 PM
You could just use:

<META http-equiv=refresh content=0;URL=http://www.yoursite.com>

Replacing the red sections with what you want.

hairynugs6382
09-06-2002, 12:45 AM
the reson that script is not working is cause u forgot the
<script>&</script> tags copy this:

<form name="redirect">
<center>
<font face="Arial">
<b>You will be redirected to the script in<br>
<br>
<form><input type="text" size="3" name="redirect2">
</form>seconds</b>
</font>
</center>
<script><!--
/*Copyright 2000 Stephen Shellard (c)*/
//change below target URL to your own

var targetURL="http://www.a1javascripts.com"

//change the second to start counting down from

var countdownfrom=10

var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout("countredirect()",1000)
}

countredirect()
//-->
</script>


I would just use meta tag like galdo said it will be easier 4 u!