you can declare a variable as global using the Global function:
global $total_price;
global $items;
if(!$items) $items = "0";
if(!$total_price) $total_price = "0.00";
I think variables are reigistered via "Post" in a form.
Or a varianle is automatically registered when entered
example:
$name="SeanPaulCaillouette"
the variable name now has a value that can be accessed anywhere in the scripts since it is not within a function call.
If the variable is registered within a function call
function register_name() {
$name="seanPaulCaillouette"}
now name is local because it is within a function.