<?
/*Hi I having problem that I can't get variables from one function to another function in same page.
*/
function first_function($test) {
global $test;//declaring $test global but still I can't run $query in second_function
echo "
<form>
<input type='text' name='test'>
<input type='submit'>
</form>";
}
function second_function() {
$query = "SELECT * FROM teble WHERE name='$test'";
echo "$query"; //here is $test EMPTY but WHY???
}
if (!isset($test)) {
first_function();
}
else second_function();
// thanx...
?>