You're confused as to what globals are.
Global values are for use in a script that may require access to a value out of its scope but within that instance of the script:
PHP Code:
$Value = 'foobar';
function test()
{
print $Value; //Error - undefined variable type message
}
function test2()
{
global $Value;
print $Value; //Successful
}
test();//Error
test2();//Success
What you want to be using is SESSIONS. Sessions are remembered between scripts. To start or resume a session you use session_start. To store anything in the session or access a session value you use the $_SESSION array.
enter_new_pass.php:
PHP Code:
session_start(); //You MUST use this in every script that accesses a users session
$id = $_GET['id'];
$uniq = $_GET['unique'];
$_SESSION['id'] = $id;
$_SESSION['uniq'] = $uniq;
do_new_pass.php:
PHP Code:
session_start();
$id = $_SESSION['id'];
$uniq = $_SESSION['uniq'];
print "$id, $uniq";