Forum Moderators: coopster
<?php // takes all the tasks in content files in a folder and prints them as links
$dir = "content/";
$page = $_GET['page'];
if (!is_file($dir.$page.".menu")) {
$page = 'def';
}
$menu_handle=fopen($dir.$page.".menu","r");
while(list($name,$call)=fscanf($menu_handle,'%s\t%s\n')){//only name is grabbed
echo $call,$name;\\debug echo
echo "<a class='nav' href='?page=".$call."'>".$name."</a>";
}
fclose($menu_handle);
Gear Gear1
History history
I am trying to make my navigation for my page generate from files
dfeddel wrote:fscanf($menu_handle,'%s\t%s\n')
'%s\t%s\n' to "%s\t%s\n" (single quotes to double quotes). fscanf() is looking for, literally, a "\" followed by a "t" instead if the tab character.