lalalez Posted May 18, 2009 Share Posted May 18, 2009 Hi there, It's my first time here in this forum and I've have a question for you: I've created a header.php file (separatly) and I need to add code to this file, so that a little triangle appears in a menu, when a user clicks in its submenu. Here is my code: <!DOCTYPE php PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <php xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/php; charset=utf-8" /> <title>My Company</title> </head> <body> <div id="header"> <div class="header-area"> <div class="header-content"> <div class="wrap"> <h1 class="logo"><a href="index.php">Company</a></h1> <em>My Company</em> <form action=""> <fieldset class="form"> <div> <input class="text" type="text" value="search"/> </div> <input class="img" type="image" src="images/btn-go.gif"/> </fieldset> </form> </div> <ul id="MenuBar1" class="MenuBarHorizontal"> <li><a class="MenuBarItemSubmenu" href="#">About us</a> <ul> <li><a href="overview.php">Overview</a></li> <li><a href="partnerships.php">Partnerships</a></li> </ul> </li> <li> <a style="background:url(images/icon-active.gif) no-repeat 50% 100%;" class="MenuBarItemSubmenu" href="#">SERVICES</a> <ul> <li><a class="MenuBarItemSubmenu" href="services.php">Services</a></li> <li><a href="it.php">IT</a></li> <li><a href="1.php">Center</a></li> </ul> </li> <li><a class="MenuBarItemSubmenu" href="#">TRAININGS</a> <ul> <li><a class="MenuBarItemSubmenu" href="calendar.php">Calendar</a></li> <li><a href="Training1.php">T1</a></li> <li><a href="Training2.php">T2</a></li> </ul> </li> </ul> </li> <li><a class="MenuBarItemSubmenu" href="#">NEWS & EVENTS</a> <ul> <li><a class="MenuBarItemSubmenu" href="calendar.php">Calendar</a></li> <li><a href="news.php">Current News & Events</a></li> <li><a href="archives.php">Archives</a></li> </ul> </li> </ul> </div> </div> </div> </body> </php> Can please write to me the code (if statment) and tell me the place where I should put it in my code above?! I hope I'm clear with my question . Thanks Link to comment https://forums.phpfreaks.com/topic/158574-help-with-my-menu-php/ Share on other sites More sharing options...
Axeia Posted May 18, 2009 Share Posted May 18, 2009 Ummm unless I'm missing something you didn't do anything besides changing <html></html> to <php></php>. Which doesn't make a it a PHP site but rather an invalid HTML site. And creating a little triangle onclick is javascript.. not php or html. Or do you intend the provide the current page with a little triangle? Link to comment https://forums.phpfreaks.com/topic/158574-help-with-my-menu-php/#findComment-836388 Share on other sites More sharing options...
lalalez Posted May 18, 2009 Author Share Posted May 18, 2009 Thanks Axeia! Well... this is what I want to do: Move my site from HTML to PHP... To do this... I just opened my html file and saved it as .php... Is that a problem? If I'm wrong here... tell me please what should I do... ???? Link to comment https://forums.phpfreaks.com/topic/158574-help-with-my-menu-php/#findComment-836398 Share on other sites More sharing options...
Axeia Posted May 18, 2009 Share Posted May 18, 2009 Although not wrong if you did not use <?php ?> it would still render. But it does not make much sense. <php xmlns="http://www.w3.org/1999/xhtml"> and </php> in the code above are just plain wrong. I suggest to follow at least the "Basic" part of the PHP tutorial on w3schools along with advanced > includes . If you intention is just to add an image onclick you'll want to look at javascript instead of PHP though. Link to comment https://forums.phpfreaks.com/topic/158574-help-with-my-menu-php/#findComment-836425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.