I think i am being completely stupid but can someone tell my neither of these bits of code will work ?
global $criteria;
$criteria = $_HTTP_POST_VARS["seachby"];
echo "criteria: ".$criteria."<br>";
testFunction();
function testFunction(){
echo "criteria: ".$criteria."<br>";
}
the variable $criteria is printed out fine before the function, yet in the function the value is lost. I thought making a variable
global allowed you to use it within functions too ?
I also tried accessing the form variable from inside the function
as so, but it still doesn't work ?:
testFunction();
function testFunction(){
global $criteria;
$criteria = $_HTTP_POST_VARS["seachby"];
echo "criteria: ".$criteria."<br>";
}
Please help as i am going mad !!!
Thanks