Moderator:  Lixas 
			
		
		
			
				
																			
								blue-sky 							 
									
		Posts:  33  		Joined:  Tue Jun 12, 2007 3:41 pm 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by blue-sky   »  Wed Jun 13, 2007 12:10 pm 
			
			
			
			
			JavaScript redirection can be done in 3 ways :
1) Alert Redirect:
Code: Select all 
<html>
<script>
alert("This page has been moved to a new location. **** OK to be redirected.");
location = "http://www.yoursite.com";
</script>
</html> 
2) Confirm and Redirect:
Code: Select all 
<html>
<script>
if(confirm("This page has been moved to a new location. Would you like to be redirected"))
{
location = "http://www.yoursite.com";
}
else
{
history.back();
}
</script>
</html>
3) Stealth Redirect:
Code: Select all 
<html>
<script>
location = "http://www.yoursite.com";
</script>
</html> 
			
			
									
									
		
		
				
						 
		 
		 
				
			 
					
		
 
	
			
		
		
			
				
																			
								Gyanu 							 
									
		Posts:  338  		Joined:  Mon Jul 30, 2007 2:03 pm 		
		
											
							
				Contact: 
				
			 
				
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Gyanu   »  Wed Sep 12, 2007 6:47 pm 
			
			
			
			
			no u r wrong it can b done in4 ways. The forth one is  
 
[HTML]<meta http-equiv="Refresh" content="10;URL=yurpage" />[/HTML] 
 
is it write?
			
			
									
										
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Lixas 							 
									
		Posts:  750  		Joined:  Wed Feb 16, 2005 4:21 pm 		
		
						
						
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Lixas   »  Sun Sep 16, 2007 9:28 am 
			
			
			
			
			i guess that is ok 
 
			
			
									
										
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Flipper3 							 
									
		Posts:  353  		Joined:  Tue Feb 28, 2006 12:34 am 		
		
						
						
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Flipper3   »  Sun Sep 16, 2007 3:53 pm 
			
			
			
			
			Yes, those are all ways to do it except for the alert no matter what they do they will be redirected.  And secondly, you need to have:
instead of:
And finally, it is best to not to use Javascript since there are quite a bit of users that disable Javascript. 
 
			
			
									
										
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Lixas 							 
									
		Posts:  750  		Joined:  Wed Feb 16, 2005 4:21 pm 		
		
						
						
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Lixas   »  Mon Sep 17, 2007 4:18 pm 
			
			
			
			
			if user is disabled JS, you can notice him by:
Code: Select all 
<noscript>message for user when JavaScripts are disabled. HTML code is supported</noscript> 
			
			
									
										
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Flipper3 							 
									
		Posts:  353  		Joined:  Tue Feb 28, 2006 12:34 am 		
		
						
						
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Flipper3   »  Mon Sep 17, 2007 8:32 pm 
			
			
			
			
			Lixas wrote: if user is disabled JS, you can notice him by:
Code: Select all 
<noscript>message for user when JavaScripts are disabled. HTML code is supported</noscript>
Yeah, but then only the USER knows....not you.
Plus, you should want to make your website work for everybody.  That's what Google does.
 
			
			
									
										
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Gebbo 							 
									
		Posts:  554  		Joined:  Tue May 16, 2006 3:22 pm 		
		
						
						
		 
		
						
						
													
							
						
									
						Post 
					 
								by Gebbo   »  Fri Jan 25, 2008 10:48 am 
			
			
			
			
			Thanks for the tip i think i might use it for my site :P
			
			
									
										.............................:: Spirit of Fire ::..................................
 
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Tails5 							 
									
		Posts:  1302  		Joined:  Wed Mar 15, 2006 8:09 am 		
		
																
							
				Contact: 
				
			 
				
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Tails5   »  Sat Jan 26, 2008 9:41 am 
			
			
			
			
			I use PHP redirecting usually, just [php]<?php Header("Location: 
http://www.the.other/url/ ");?>[/php]
 
			
			
									
										Webmaster Yoda: You must confront the cPanel. Then, and only then, a webmaster will you be. 
 
Julius Caesar: Veni, vidi, posti 
 
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Lixas 							 
									
		Posts:  750  		Joined:  Wed Feb 16, 2005 4:21 pm 		
		
						
						
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Lixas   »  Tue Jan 29, 2008 3:25 pm 
			
			
			
			
			i guess it's the best way to redirect. but sometimes php is just not able to do that. so in this case JS will do the job
			
			
									
										
						 
		 
		 
				
			 
	
						
		
		
			
				
																			
								Flipper3 							 
									
		Posts:  353  		Joined:  Tue Feb 28, 2006 12:34 am 		
		
						
						
		 
		
						
						
						 
			 
													
							
						
									
						Post 
					 
								by Flipper3   »  Tue Jan 29, 2008 9:01 pm 
			
			
			
			
			Lixas wrote: i guess it's the best way to redirect. but sometimes php is just not able to do that. so in this case JS will do the job
In what cases is PHP not able to do that?