I try to define a new object using class
my PHP script goes below
<?
include('menu.php');
function makemenu(){
$data = "data/link.dat";
$file=fopen($data,"r")
or die ("Sorry Dude, you can not open the specified file!");
$i=0;
//$tlinks=array();
$head=array();
while (!feof ($file)) {
$line=fgets ($file, 2048);
$values=explode("||", $line);
if (($values[0] != " "))
{
$flag=substr($values[0],0,1);
if (strtoupper($flag == "M") && ($values[1] != " ") && ($values[2] != " "))
{
array_push($head,substr($values[0],1));
$head[$i]= new menu('<img src=\"button.php?fg=f00000&bg=dddddd&txt=\".$head[\".\"$i\".\"]" border=\"0\" >', '$head[$i]');
$head[$i]->add('<img src="button.php?fg=666666&bg=eeeeee&txt=\".$values.\"[1].\"" border=\"0\" >', '$values[2]', 'main');
}
} else
{
echo "nggak keluar ya menunya? he he ";
exit;
}
$i++;
}
}
?>
my question is , why this script isn't working properly
$head[$i]= new menu('<img src=\"button.php?fg=f00000&bg=dddddd&txt=\".$head[\".\"$i\".\"]" border=\"0\" >', '$head[$i]');
$head[$i]->add('<img src="button.php?fg=666666&bg=eeeeee&txt=\".$values.\"[1].\"" border=\"0\" >', '$values[2]', 'main');
best regards
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).