Anyway, if you slapped all that (and took out the echos) into a seperate PHP file as a function (let's say getUid), and added "return $unique;" at the end, you could use something like this:
PHP Code:
<?php
require_once("uidGenerator.php");
$uid = getUid();
include "pageHeader.php";
//stuff
include "pageFooter.php";
?>
Please note, you do NOT need to pass the variable $uid to the header/footer includes as
PHP variables are global by default, so will be available to any code (included or not) from the point of their declaration.