Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Forward a page using PHP (See related posts)

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

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

Comments on this post

opeyemi posts on May 11, 2007 at 15:39
i need source codes on php to study.How to declare variable,connect to the database,retrieve data etc.
stayefeh posts on May 20, 2007 at 09:13
Hi opeyemi,

I have written a simple class that contains some methods that might be useful for you. Check out:

http://www.ilenvo.de/kunden/sascha/index.php?mode=mysqlclass

Sincerly
ST

You need to create an account or log in to post comments to this site.


Click here to browse all 5140 code snippets

Related Posts