what i need to do is set 5 arrays, gathered from a file. i need the same code that is contained in setvariables.php for at least 5 pages some in different folders than others.
so i set the $filename, then add the include afterwards. is this OK to do or is it frowned upon? it works, but i don't want any trouble later on. it doesn't seem that i can make a function for the setvariables.php php, since i need to return 5 arrays.
<?php
$filename = "data/tabledata.dat";
include('data/connection.php');
include('data/setvariables.php');
echo= $name[3];
?>
setvariables.php
<?php
if (!($fp = fopen($filename, "r")))
exit("Unable to open the input file.");
while (!feof($fp))
{
$buffer = fscanf($fp, "%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]|%[a-zA-Z0-9,. ]" , $what[], $name[], $type[], $length[], $option[]);
}
fclose($fp);
?>