Hi All,
I'm turning mad with global variables...
In created a simple test script with 2 functions which worked fine but the
other one i need doesn't work. Register_globals is On.
Here are the relevant parts of my script:
//Save form data in an array
function add_ota_elements($form_data)
{
$otavars = $GLOBALS["otavars"];
$otavars[ota_name] = $form_data[name];
}
function create_new_gprs_dialup()
{
$otavars = $GLOBALS["otavars"];
echo $otavars[ota_name]; //To see if the form data is well saved
}
switch ($action)
{
case add_ota_elements:
add_ota_elements($form_data);
break;
case create_new_gprs_dialup:
create_new_gprs_dialup();
break;
}
$otavars[ota_name] in the second function is empty. Can anybody explain to
me why it is so. I guess it is related to the switch instruction but i
can't understand why.
Thanks in advance for you help.
Stephane