ADVERTISEMENT


Breaking News

Recent Posts

Tuesday, December 16, 2014

How to redirect user with PHP


Its very easy to redirect user with php, without using any script because script isn't safe way to redirect a user:
using below Method you can redirect user quickly.

1:  <?php  
2:   header( 'Location: http://www.yoursite.com/new_page.html' ) ;   
3:   ?>  

Be sure that there is no text sent to browser, it will not work in this way :

1:  <html>   
2:  <?php  
3:   //if browser get any text befre this script it will not work   
4:  header( 'Location: http://www.yoursite.com/new_page.html' ) ;   
5:  ?>  

No comments:

Post a Comment

Designed By Published.. Blogger Templates