·: Site description :·
Welcome!

NetBulge.com provides code, scripts, tips & tricks and general information about web development aimed to help webmasters and web designers.

Instead of packing all the info we can get into a huge database, our goal is to produce a high quality compilation of code snippets and articles. Web developers will find in these pages a fresh and savvy view of most of the issues concerning programming and designing for the web; as well as a good site to visit regularly for help and inspiration.

Enjoy!
Zones
Navigation
Search

Sessions

NetBulge.com RSS2 feed



About Hosting:

I use and recommend Hostgator for all my hosting needs. It is the only company I have tried (and I have tried plenty) that hasn't given me a headache and responds quickly and fairly to everything I ever need. I run 3 accounts that host over 20 sites with Hostgator and I am happy recommending it to all my family, friends and clients. If you are looking for a cheap yet solid host, IMO Hostgator is the way to go. I do get a comission if you register through the link, but even if you don't like me and don't want me to get a comission, go to Hostgator for your hosting needs and save yourself plenty of cash and headaches.


 Print version Send article via e-mail  

PHP: Redirect pages


web zone resourcesPage redirection is very useful. Often visitors are forced to see error or confirmation pages. Sometimes pages have been moved but the link must remain active to catch visitors that are not aware of the page redirection yet. In such cases, an automatic redirection is in order.


To redirect a page using PHP you can send a header:

header('location:page2.php');

Or,

header('location:http://www.mysite.com/page2.php');

Just make sure the code is placed before any other output is generated; preferably at the top of the page. If this is not possible, you can also use a Javascript redirect:

<script>document.location.href='page2.php'</script>

Or,

<script language="Javascript" type="text/javascript">
document.location.href='http://www.mysite.com/page2.php'
</script>



Author : Esopo, Read 14719 times, Comments: 2
Rating :  rating resourcesrating resourcesrating resourcesrating resourcesrating resourcesrating resourcesrating resourcesrating resourcesrating resourcesrating resources  |  Tuesday, 19. April 2005

Add new comment/Comments
Your rating :   Poor ranking resourcesrating resourcesrating resourcesrating resourcesrating resources Excellent




css stylescss stylesDo you have something to say?
Then say it! NetBulge.com is devoted to web development. We are always looking for fresh and relevant ideas. If you are a web designer with a voice, this is the place to make it heard. Join us!

Featured *
It almost felt like a joke finding out about this type of server packs after spending a couple of days working hard to setup my personal web server to test my PHP – MySql scripts. Reactor server comes with Apache, PHP, MySql, SQLite, phpMyAdmin, Nuke, etc, and all in an almost plug and play package. If you don’t have one of these in your PC, you better be asking yourself why. – The only draw back: about 38 MBs in size.
NOTE: This is ver1.2 that supports PHP 4. For the latest version visit their homepage.

If you are a web developer, this link is a must in your quick-links bar. A visit to this site will clear even the most diligent creative-block.
http://www.k10k.net/