How to Redirect with PHP


With this article you will learn how to redirect your users to another page with a simple PHP function. This becomes really handy when you have authenticated your user and want to take it back to the home page, for example.

1. The function we will use is header()

The syntax is easy: header(“Location: http://theurl.tld“);

2. If we want to redirect to, we would use:


That’s it! Really simple, but one of the most used functions in real world website developing. If you have questions about this, comments or article suggestions, please do not hesitate to contact me and I’ll be more than glad to assist you.

Best Regards,


Owner of Juapo2Services

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , | Posted under Programming/Coding | RSS 2.0

Author Spotlight

Richi González

I started programming when I was 12. I'm a Developer and have been working with the Clip-Bucket script since it came out. I'm the Liaison between Arvixe and Clip-Bucket, so anything you need regarding Clip-Bucket or any particular computer-related subject you need, let me know so I can assist you.

Leave a Reply

Your email address will not be published. Required fields are marked *