I'm presuming you've got a basic understanding of PHP variables...
This code will load the contents of a file into a variable:
PHP Code:
$filename = 'file.txt';
$fp = @fopen($filename, 'r');
if (!$fp)
die('Could not open file.');
$contents = fread($fp, filesize($filename));
fclose($fp);
That will read the contents of the file "file.txt" into a variable called $contents. Here's the code for a redirect:
PHP Code:
<?php
header("Location: anotherpage.html");
?>
The redirection code needs to be called BEFORE any HTML is sent to the browser as it creates a "header" for the page.
Hope that helps,
Skunk
Bookmarks