\n\ntarget\">\n"); print("style\" "); print("type=text/css>\n\n\n\n\n"); } function main($label) { print("url\""); if($label->target) print(" target=\"$label->target\""); print(">$label->dat
\n"); } function sub($label) { print("  url\""); if($label->target) print(" target=\"$label->target\""); print(">$label->dat
\n"); } // import database configuration and functions require("db.php3"); // connect to the database $connection = connect($host, $dbname); if($connection) { // setup query value $query = "select * from menu where content = \"$content\""; $result = query($connection, $query); if($result) { $menu = fetch_object($result,0); $mid = start($menu); // query for menu labels $query = "select * from label where mid=\"$mid\" order by ord"; $result = query($connection, $query); $count = numrows($result); if($count) { // dynamically call a function for each record // based on the contents of its "type" field for($row=0; $row < $count; $row++) { $label = fetch_object($result, $row); $function = $label->type; $function($label); } finish($menu); } } } ?>