Ada beberapa cara membuat pengalihan url dari satu halaman ke halaman lain, diantaranya menggunakan Javascript . Berikut adalah beberapa script yang bisa Anda gunakan :
<script language='javascript' type='text/javascript'>
//Simple Redirect Javascript
window.location.href='login.php?backurl='+window.location.href;
</script>
<script language='javascript' type='text/javascript'>
alert('kembali');
window.history.back(-1);
</script>
<script language='javascript' type='text/javascript'>
window.navigate('url.html');
</script>
<script language='javascript' type='text/javascript'>
alert('Akses Terbatas');
top.location='error.html';
</script>
<script language='javascript' type='text/javascript'>
self.location='url.htm';
</script>
<script language='javascript' type='text/javascript'>
//Javascript Dengan Timer
window.setTimeout('window.location="http://www.urltujuan.com"; ',2000);
</script>
<form name="redirect">
<center>
<font face="Arial"><b>You will be redirected to the script in
<form>
<input type="text" size="3" name="redirect2">
</form>
seconds</b></font>
</center>
<script>
<!--
/*
Javascript Timer Dengan Perhitungan Mundur Di Tampilkan
Count down then redirect script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/
//Ubah Url Tujuan Yang Anda Inginkan
var targetURL="http://www.example.com/"
//change the second to start counting down from
var countdownfrom=7
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()
//-->
0 komentar:
Post a Comment