0

So this is my code:

<?php

// Example in menu_skuska.html 
$buffer = '';
function addMenuHeader($header_name,$id,$distance_from_top,$distance_from_left)
{
    global $buffer;
    $buffer = $buffer + '<div style="position:absolute; top:' + $distance_from_top + '; left:' + $distance_from_left + ';">';
    $buffer = $buffer + '<p onClick="toggleMenu(' + $id + ')" id="menu_header">' + $header_name + '</p>';
    $buffer = $buffer + '<div id="' + $id + '" style="visibility:hidden;">';
}

function addMenuItem($item_name,$link)
{
    global $buffer;
    $buffer = $buffer + '<a href="' + $link + '">' + $item_name + '</a><br>';
}

function finalizeMenu()
{
    global $buffer;
    $buffer = $buffer + '</div></div>';
}

function printMenu()
{
    global $buffer;
    echo($buffer);
}

addMenuHeader('Click me','menu1','100px','100px');
addMenuItem('Google','http://www.google.com');
addMenuItem('Facebook','http://www.facebook.com');
finalizeMenu();
printMenu();

?>

and it's output is number 200 instead of what i want
what i want is to output like this piece of code does:

<div style="position:absolute; top:10%; left:10%; color:green;">
    <p onClick="ToggleMenu(toggled)" style="cursor: pointer;">skuska</p>
    <div id="toggled" style="visibility:hidden;">
        skuska2<br>
        skuska3
    </div>
</div>

any ideas??? ... please help me

2
Contributors
1
Reply
18
Views
4 Years
Discussion Span
Last Post by EvolutionFallen
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.