I am trying to move my html website to PHP but the menu's drop-down isn't working on the PHP version but does work on the html version but its the same code. But it doesn't do the dropdown anymore, anyone know what i'm doing wrong?
This is the index.php:
<!DOCTYPE html>
<html>
<head>
<?php $cpage = 'index';?>
<?php include 'php/head.php'; ?>
</head>
<body class=' tall-header-page wsite-theme-dark wsite-page-index'>
<div id="wrapper">
<?php include 'php/header.php'; ?>
<div id="content"><div id='wsite-content' class='wsite-elements wsite-not-footer'>
<div>
<div id="873211056530182798" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><h1> Website Content</h1>
<p>some paragraphs on my website
</p>
</div>
</div>
</div>
</div>
<?php include 'php/footer.php'; ?>
</div>
</body>
</html>
head.php (file where the JavaScript is):
<?php function pageTitle($cpage, $paget) {
if ($cpage == 'index') {
echo 'My Website';
}
else {
if ($cpage == 'nil') {
if (!($paget == 'nil')) {
echo $paget;
}
else {
echo 'unnamed';
}
}
else {
if ($cpage == 'forums') { echo 'Forums'; }
if ($cpage == 'gallery') { echo 'Gallery'; }
if ($cpage == 'contact-us') { echo 'Contact Us'; }
if ($cpage == 'shop') { echo 'Shop'; }
if ($cpage == 'chat') { echo 'Chat'; }
if ($cpage == 'map') { echo 'Map'; }
if ($cpage == 'more') { echo 'More'; }
echo ' - My Website';
}
}
}
?>
<title><?php pageTitle($cpage, $paget); ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel='stylesheet' type='text/css' href='files/main_style.css?headphp' title='wsite-theme-css' />
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script src='https://cdn2.editmysite.com/js/site/main.js?buildTime=1382727638'></script>
<script type='text/javascript'><!--
var IS_ARCHIVE=1;
var DISABLE_NAV_MORE=1;
(function(jQuery){
function initFlyouts(){initPublishedFlyoutMenus([{"id":"571779416291536449","title":"Home","url":"index.html","target":""},{"id":"342221422248745917","title":"Forums","url":"forums.html","target":""},{"id":"874674047933364332","title":"Gallery","url":"gallery.html","target":""},{"id":"539931738322947695","title":"Contact Us","url":"contact-us.html","target":""},{"id":"676890936889766458","title":"Shop","url":"shop.html","target":""},{"id":"784244911250776136","title":"Chat","url":"chat.html","target":""},{"id":"241193229266563693","title":"Map","url":"map.html","target":""},{"id":"733668578474496125","title":"More","url":"more.html","target":""}],'609122203481674254',"<li class='wsite-nav-more'><a href='#'>more...<\/a><\/li>",'',false)}
if (jQuery) {
if (jQuery.browser.msie && !window.flyoutMenusRefreshable) window.onload = initFlyouts;
else jQuery(initFlyouts);
}else{
if (Prototype.Browser.IE) window.onload = initFlyouts;
else document.observe('dom:loaded', initFlyouts);
}
})(window._W && _W.jQuery)
//-->
</script>
header.php (where the menu is):
<?php
function isActive($cpage, $page) {
if ($cpage == $page) {
echo '\'active\'';
}
else {
echo '\' \'';
}
}
?>
<div id="navigation"><ul class='wsite-menu-default'><?php echo '<li id=';isActive($cpage, 'index'); echo '><a href="index.php">Home</a></li><li id='; isActive($cpage, 'forums'); echo '><a href="forums.php">Forums</a></li><li id='; isActive($cpage, 'gallery'); echo '><a href="gallery.html">Gallery</a></li><li id='; isActive($cpage, 'contact-us'); echo '><a href="contact-us.html">Contact Us</a></li><li id='; isActive($cpage, 'shop');echo '><a href="shop.html">Shop</a></li><li id='; isActive($cpage, 'chat'); echo '><a href="chat.html">Chat</a></li><li id='; isActive($cpage, 'map'); echo '><a href="map.html">Map</a></li><li id='; isActive($cpage, 'more'); echo '><a href="more.html">More</a>'; ?> <div class='wsite-menu-wrap' style='display:none'><ul class='wsite-menu'><li id='wsite-nav-609122203481674254'><a href='more1.html' ><span class='wsite-menu-title'>More 1</span></a></li><li id='wsite-nav-445833026342057317'><a href='more2.html' ><span class='wsite-menu-title'>More 2</span></a></li><li id='wsite-nav-465278515522467873'><a href='more3.html' ><span class='wsite-menu-title'>More 3</span></a></li><li id='wsite-nav-711863572227927285'><a href='more4.html' ><span class='wsite-menu-title'>More 4</span></a></li></ul></div></li></ul></div>
The view source:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel='stylesheet' type='text/css' href='files/main_style.css?headphp' title='wsite-theme-css' />
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<script src='https://cdn2.editmysite.com/js/site/main.js?buildTime=1382727638'></script>
<script type='text/javascript'>
var IS_ARCHIVE=1;
var DISABLE_NAV_MORE=1;
(function(jQuery){
function initFlyouts(){initPublishedFlyoutMenus([{"id":"571779416291536449","title":"Home","url":"index.html","target":""},{"id":"342221422248745917","title":"Forums","url":"forums.html","target":""},{"id":"874674047933364332","title":"Gallery","url":"gallery.html","target":""},{"id":"539931738322947695","title":"Contact Us","url":"contact-us.html","target":""},{"id":"676890936889766458","title":"Shop","url":"shop.html","target":""},{"id":"784244911250776136","title":"Chat","url":"chat.html","target":""},{"id":"241193229266563693","title":"Map","url":"map.html","target":""},{"id":"733668578474496125","title":"More","url":"more.html","target":""}],'609122203481674254',"<li class='wsite-nav-more'><a href='#'>more...<\/a><\/li>",'',false)}
if (jQuery) {
if (jQuery.browser.msie && !window.flyoutMenusRefreshable) window.onload = initFlyouts;
else jQuery(initFlyouts);
}else{
if (Prototype.Browser.IE) window.onload = initFlyouts;
else document.observe('dom:loaded', initFlyouts);
}
})(window._W && _W.jQuery)
</script>
</head>
<body class=' tall-header-page wsite-theme-dark wsite-page-index'>
<div id="wrapper">
<div id="navigation"><ul class='wsite-menu-default'><li id='active'><a href="index.php">Home</a></li><li id=' '><a href="forums.php">Forums</a></li><li id=' '><a href="gallery.html">Gallery</a></li><li id=' '><a href="contact-us.html">Contact Us</a></li><li id=' '><a href="shop.html">Shop</a></li><li id=' '><a href="chat.html">Chat</a></li><li id=' '><a href="map.html">Map</a></li><li id=' '><a href="more.html">More</a> <div class='wsite-menu-wrap' style='display:none'><ul class='wsite-menu'><li id='wsite-nav-609122203481674254'><a href='more1.html' ><span class='wsite-menu-title'>More 1</span></a></li><li id='wsite-nav-445833026342057317'><a href='more2.html' ><span class='wsite-menu-title'>More 2</span></a></li><li id='wsite-nav-465278515522467873'><a href='more3.html' ><span class='wsite-menu-title'>More 3</span></a></li><li id='wsite-nav-711863572227927285'><a href='more4.html' ><span class='wsite-menu-title'>More 4</span></a></li></ul></div></li></ul></div>
</div>
<div id="content"><div id='wsite-content' class='wsite-elements wsite-not-footer'>
<div>
<div id="873211056530182798" align="left" style="width: 100%; overflow-y: hidden;" class="wcustomhtml"><h1> Website Content</h1>
<p>some paragraphs on my website
</p>
</div>
</div>
<div id="footer">© 2013 <a href="http://example.com/">My Website</a></div>
</div>
</body>
</html>