Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:43
Using Menu with PHP
Poster: cjlive
Dated: Sunday September 22 2002 - 14:10:10 BST
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:
Poster: dk_akj
Dated: Monday September 23 2002 - 6:23:21 BST
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