I have the following PHP code, which is stored in a seperate PHP file to the index.php file I am using.
The page include()'s fine into the index.php file when not within a function.
$_3_dart_score = $_POST["user-input"];
$remaining_score = 501 - $_POST["user-input"];
However when it is included with an function, it doesn't seem to work.
<?php
function throw()
{
$_3_dart_score = $_POST["user-input"];
$remaining_score = 501 - $_POST["user-input"];
global $_3_dart_score
global $remaining_score
throw();
}
?>
I have tried all sorts, even calling the function from the index.php page, however nothing seems to work.