Thursday, October 17, 2013

3 ways how to redirect using HTML, PHP and Javascript

Hello! Today I'll show you how to create a page that redirects user to another one.

1. The HTML way.

It's very simple HTML META redirect. Note: If you change "0" to "3" or "7", page will redirect after 3 or 7 seconds.

 <html>  
 <head>  
 <meta http-equiv="refresh" content="0; url=http://example.com/">  
 </head>  
 <body>  
 </body>  
 </html>  


2. PHP way.

A little bit harder (for the beginners), because your server has to execute *.php files and you have to save the following code with *.php extension.

 <?php  
 header("Location: http://example.com");  
 ?>  


3. Javascript way.

In this example we will use a self-posting HTML form to redirect the user.

 <html>  
 <body>  
      <form action="http://example.com" method="post" id="redirectform">  
      </form>  
        
      <script language="JavaScript"> document.getElementById('redirectform').submit();</script>  
 </body>  
 </html>  


What method is the best? I don't know, because it depends on redirect purpose. To normal use, 1 & 2 are good. The 3rd one is a little bit "tricky". Technorati code: KX7KUCYAZAFK

Tuesday, October 15, 2013

2 awesome Viking Metal songs

Týr - Turið Torkilsdóttir (the whole album is awesome!)



Einherjer - The Ballad of the Swords - Einherjer is quite amateur band, but really rocks!

Hello world!

Today I decided to create my personal blog! I will write things about programming, my projects and just me. You can also meet me on Twitter.