How to Redirect with PHP

Hello,

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 http://www.arvixe.com, we would use:

header("Location: http://www.arvixe.com");

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,

Richi

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

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 became a Liaison between Arvixe and Clip-Bucket, so I am here to assist you with anything you need regarding Clip-Bucket or any particular computer-related subject you need. Best Regards, Richi

Leave a Reply

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


9 × 9 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>