p_a 0 Report post Posted September 23, 2005 I have many PHP Books, PHP Bible among others, but no clear description how to build menus (dynamic) Javascript like. Is PHP enough strong to do this? I also have Javascript Bible, many possibilities are usable within PHP pages.Anybody has experience in creating dynamic menus in PHP? Share this post Link to post Share on other sites
moldboy 0 Report post Posted September 24, 2005 How do you mean dymanic? if you mean like the mouse over and display alternate options, then I really don't think so, that is a javascript, dhtml, css, or flash relm, something client side, the only way a mouse over menu would work with php is if by some action you could submit the page on mouseover and return new results, but taht wouldn't be efficeant.Besides the very name, PHP bible, probably wouldn't tell you how to do something with Javascript if it could be done with PHP. Share this post Link to post Share on other sites
arboc7 0 Report post Posted September 24, 2005 You cannot create any dynamic menus using PHP because it executes on the server, not at the client. JavaScript executes on the client-side, so much more dynamicity is available. A few people have figured out how to create multi-level "pop-out" menus using CSS, and if you want to find that, just google it!Sorry that you can't use PHP for your menus... Share this post Link to post Share on other sites
Spectre 0 Report post Posted September 24, 2005 You can use PHP to send the HTML/DHTML/JavaScript/whatever code to the client. The dynamic generation could be done with PHP to change the entries the menu contains, for example. The actual menu would be constructed using, most likely, a combination of HTML and JavaScript. I don't know why anyone would want to do this - menus are usually a static method of travelling around a web site. Â Such as: <?phpecho '<whatever>' . date('M jS') . '</whatever>';?> Share this post Link to post Share on other sites
p_a 0 Report post Posted September 24, 2005 Javascript is, of course, very usable. I used even few Javascript menu generators. But, sometimes I would like to do something like this: I have a website with, for example 10 webpages. I want to have the same header and footer at all of them. I make pages, and include the header.php at the top, and the footer.php at the bottom. Javascript menu is in the header.php. Menu is simple, and complete inside one function. When I started website from initial index.something (may be .php or .html) I do not see the header at all (even it's included). The most interesting thing is the fact: I save the Javascript function to the .js file, I put the line of code where I am calling the .js from header.php, and - everything works! Why? Where is the problem? It has to work both ways by any logic! Because it's the same thing. Or it is not. Share this post Link to post Share on other sites
Amezis 0 Report post Posted September 24, 2005 Your server probably don't support PHP scripting, so none of your PHP scripts will work.PHP, ASP etc are server-side scripts, so the programs to run the scripts has to be installed on the server.Javascript is a browser-side scripting language, so it will work as long as the browser supports it.If, you get hosted here on Xisto, your PHP scripts will work. Share this post Link to post Share on other sites
p_a 0 Report post Posted September 24, 2005 I can see the complete page with header and footer included. Problem is the menu in header. If the Javascript code function is inside the header.php it will not work, it will not be visible in the webpage. If it is outside header.php as, for example menu.js, I just put the ordinary code to call the Javascript from header.php, it works perfect. Share this post Link to post Share on other sites
sobhan 0 Report post Posted October 2, 2005 I tink you can use Java n PHP. But i am not shure. Like this <?phpprint_f '<html><head><script laguange="javascript"....></script></head></html>';?> Share this post Link to post Share on other sites