We Recommend

Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems Wicked Cool PHP: Real-World Scripts That Solve Difficult Problems
Wicked Cool PHP contains a wide variety of scripts to process credit cards, check the validity of email addresses, template HTML, and serve dynamic images and text.


Posted By

willcodeforfood on 12/17/07


Tagged


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

vali29
basicmagic
robotoverlord
pagetoscreen


Forward a page using PHP


Published in: PHP 


URL: http://snippets.dzone.com/posts/show/3863

Often, forwarding web pages is done with .htaccess. But sometimes you don't want to mess with editing .htaccess (or you may not have access to it). You can do HTML forwarding, but PHP allows you to use a more transparent method (and you'd like to retain referrer information). Just edit the code below and add it to the page in question.

  • Thank to Rollie Hawk

http://snippets.dzone.com/posts/show/3863

  1. <?php
  2. header("Location: http://domain.tld/page.php");
  3. ?>

Report this snippet 

You need to login to post a comment.