Group: Hackerss Member
Posts: 1
Joined: 21-September 08
Member No.: 5,546
Hola amigos de hackerss, estoy iniciando en esto de php con base de datos y webs dinamicas y quisiera ayuda para crear un menu dinamico desde base de datos, para empezar tengo las tablas creadas una llamada: menu, campos: id_menu y nombre_menu y otra submenu, campos: id_submenu y submenu
ARCHIVO DE CONEXION:
<?
mysql_connect ("localhost", "root", "root") or die ('No se conecto con la base de datos');
<script type=text/javascript> function Browser() { var ua, s, i; this.isIE = false; this.isNS = false; this.version = null;
ua = navigator.userAgent;
s = "MSIE"; if ((i = ua.indexOf(s)) >= 0) { this.isIE = true; this.version = parseFloat(ua.substr(i + s.length)); return; }
s = "Netscape6/"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = parseFloat(ua.substr(i + s.length)); return; }
s = "Gecko"; if ((i = ua.indexOf(s)) >= 0) { this.isNS = true; this.version = 6.1; return; } }
var browser = new Browser(); var activeButton = null; if (browser.isIE) document.onmousedown = pageMousedown; else document.addEventListener("mousedown", pageMousedown, true); function pageMousedown(event) { var el; if (activeButton == null) return; if (browser.isIE) el = window.event.srcElement; else el = (event.target.tagName ? event.target : event.target.parentNode); if (el == activeButton) return; if (getContainerWith(el, "DIV", "menu") == null) { resetButton(activeButton); activeButton = null; } }
function buttonClick(event, menuId) { var button; if (browser.isIE) button = window.event.srcElement; else button = event.currentTarget; button.blur();
if (button.menu == null) { button.menu = document.getElementById(menuId); menuInit(button.menu); }
function buttonMouseover(event, menuId) { var button; if (browser.isIE) button = window.event.srcElement; else button = event.currentTarget; if (activeButton != null && activeButton != button) buttonClick(event, menuId); }
function depressButton(button) { var x, y; button.className += " menuButtonActive"; x = getPageOffsetLeft(button); y = getPageOffsetTop(button) + button.offsetHeight;
if (browser.isIE) { x += button.offsetParent.clientLeft; y += button.offsetParent.clientTop; }
button.menu.style.left = x + "px"; button.menu.style.top = y + "px"; button.menu.style.visibility = "visible"; }
function resetButton(button) { removeClassName(button, "menuButtonActive");
function menuMouseover(event) { var menu; if (browser.isIE) menu = getContainerWith(window.event.srcElement, "DIV", "menu"); else menu = event.currentTarget; if (menu.activeItem != null) closeSubMenu(menu); }
function menuItemMouseover(event, menuId) { var item, menu, x, y; if (browser.isIE) item = getContainerWith(window.event.srcElement, "A", "menuItem"); else item = event.currentTarget; menu = getContainerWith(item, "DIV", "menu");
if (browser.isIE) { w = itemList[0].offsetWidth; itemList[0].style.width = w + "px"; dw = itemList[0].offsetWidth - w; w -= dw; itemList[0].style.width = w + "px"; } }
function getContainerWith(node, tagName, className) { while (node != null) { if (node.tagName != null && node.tagName == tagName && hasClassName(node, className)) return node; node = node.parentNode; }
return node; }
function hasClassName(el, name) { var i, list; list = el.className.split(" "); for (i = 0; i < list.length; i++) if (list[i] == name) return true; return false; }
function removeClassName(el, name) { var i, curList, newList; if (el.className == null) return; newList = new Array(); curList = el.className.split(" "); for (i = 0; i < curList.length; i++) if (curList[i] != name) newList.push(curList[i]); el.className = newList.join(" "); }
function getPageOffsetLeft(el) { var x; x = el.offsetLeft; if (el.offsetParent != null) x += getPageOffsetLeft(el.offsetParent); return x; }
function getPageOffsetTop(el) { var y; y = el.offsetTop; if (el.offsetParent != null) y += getPageOffsetTop(el.offsetParent); return y; } </SCRIPT> <META content="MSHTML 6.00.6000.16681" name=GENERATOR></HEAD> <?