Using Menu with PHP

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
cjlive
Beginner
Beginner
Posts: 5
Joined: Sun Sep 22, 2002 2:01 pm

Using Menu with PHP

Post by cjlive »

How would one go about using this menu script within php.

If i load the menu within my index.php , i cant get the menu to show.
So does any1 know how to run the script within the php tags.

I'd also like to change the .js files to .php , i'v read a earlier post about this but it dosen't allow the index to be in php.

I'd prefer doing it this way for file and code security.......

Thanks

Great Script BTW .........

CJ - a scripting newbie lol :mrgreen:
dk_akj
Beginner
Beginner
Posts: 4
Joined: Thu Sep 19, 2002 11:56 am

Post by dk_akj »

Hi cj.

I dont know anything about php but i have created a menu dynamically in asp.

' this is a function that creates then main part af a menu.
function createmenu (name)
response.write "addmenu(menu=['"&name&"',,,120,1,,style1,0,'left'," & chr(34) & "randomdissolve(duration=0.3);Shadow(color='#999999', Direction=135, Strength=5)" & chr(34) & ",0,,,,,,,,,,,,"
end function

' following im building a menu with misc things. Data is taken from the database

' this is the sql
sql = "select * from m_misc order by name asc"

' execute the sql
set rs = conn.execute (sql)

' call the menu function (shown above)
createmenu "misc"
' reset counter ( used to seperate submenuitems
ll_count = 0

' loop trough the results from database
do while not rs.eof
' if the counter > 0 (not the first loop) we seperate submenuitems with a ,
if ll_count > 0 then
response.write ","
end if
' build submenuitem
response.write "'"&rs("name")&"','"&rs("link")&"',,,1"
' increase the counter by one
ll_count = ll_count + 1
' move to the next record in resultset
rs.movenext
loop
' write the end of the menu.
response.write "]);"


Note that lines might wrap.
I hope that this can help you.

//dk_akj
Post Reply