Finding CSS

After adding this:
ini_set(‘include_path’,ini_get( ‘include_path’ ). “:/home/.xxxx/jvzusr/pear/php”);
things worked just fine - until I wanted to use CSS style sheets in my app, suddenly it could not find them.(and other .txt files using fopen())
Even putting it in the full path path like below does not solve the problem?

<link rel="stylesheet"

Johan van Zyl


[/quote] Ick. Firstly, there is no closing tag (""). Second, any CSS files for your site should be kept within the confines of the folder used for your website, NOT in folders used for program compilations. For example, if copied that .css file into the same folder where you keep your index.html (or index.php) file, the link META tag would read: [code][/code]

This is the code as supplied:

Complete Demo of the PHP Layers Menu System The css files are in the same folder as the index.php and it worked perfectly until I added ini_set('include_path',ini_get( 'include_path' ). ":/home/.xxxxx/jvzusr/pear/php:.");. Then the index.php suddenly could not "see" them anymore!

Johan van Zyl

This is the product I am using:
phpLayersMenu is an elaborate SourceForge-hosted package by Marco Pratesi and is certainly the most flexible of all packages I have examined. It supports menus that are either static or dynamic on the client (i.e. with or without JavaScript), potentially an excellent feature. The major supported forms are static tree menus, vertical menus with DHTML slideouts, and horizontal menus with DHTML slideouts.

PhpLayersMenu includes more documentation than almost any other package, but the documentation largely describes the theory of operation, not how to use the package. Some of its internals are inspired by Bjorge Dijkstra’s PHP Tree Menu 1.1 (not to be confused with the Sword Su TreeMenu described previously). The connection is not obvious to the user – phpLayersMenu is far more sophisticated – but is evident in the structure of the menu definition files.

The demo shows an especially nice example of a tree structured menu that’s static on the client (can be expanded by going back to the server). I haven’t determined yet if it will produce a DHTML version of that same menu.

The client-side JavaScript includes browser detection and supports many different browsers.

Menu structure is read from menu definition files, or can be specified in string format. Personally I prefer to separate this function from the operation of the menu itself. For example, I like the way in which HTML_TreeMenu lets the user build the menu tree programmatically. Then the storage of menu structures is completely independent from the menu package. So many menu packages make a big deal of this: store your menus in XML, in mySQL, in text files, etc. But it is actually irrelevant to the operation of the menu system.

The programming interface is practical, but somewhat verbose. I didn’t like it at first, but much of the verbosity is the necessary price for some of the features, e.g. setting custom graphic icons. Some of it is rather strange: the same menu object can be associated with many completely different menus, each retrievable by name. I would think that different menu structures should be different menu objects.

The package depends upon the PHPLib Templates feature, which is bundled with it, and is used to control the HTML generated for the menus. While at first this may seem to add to the complexity of the package, in practice it will make the menus much easier to customize without hacking the code.

Local Demo: phplayersmenu-2.2.0/
Home: see also
Last Updated: 2002-10-12 (v2.2.0)

Johan van Zyl

Have you got a suggestiuon for a good menu class, preferably one that uses MySQL?

Johan van Zyl

You’ve got some learning to do. lol

Okay, here’s the deal: there’s backend programming languages ran by the server and there’s front end languages ran by the browser. Two completely different beasts (well, unless you work with IE and MS languages).

Front end languages CANNOT talk to back end langauges w/out going through the HTTP(S) protocol.

Now, where’s you’re getting things mixed up is here. This is a list of Backend laguages: ASP, PHP, Perl, JSP, bash, C, C (etc). Here’s a list of front end languages: HTML, XML, JavaScript.
Note, no CSS. :wink:

Backend languages talk to MySQL. Front end language cannot.

Now where CSS comes in. CSS is a front end command set only. What it does is tell browsers HOW to “run” (display) the HTML language. That’s it. CSS is not, in any fashion, a programming language. It cannot talk to any MySQL database. It cannot talk to PHP or any other backend language.

Did I clear some things up for you? Or did I just make your head spin even more. :slight_smile:

It’s very important you understand this. Your questions and understanding of the web are WAY off on how things really are. You’ll either get screwed (by a developer) or get completely lost with your current knowledge of how things work. Read up some more. Find tutorials and make sure you understand the difference between the two sides: backend and front end.

yerba# rm -rf /etc

I have been a programmer since 1979 and although I only recently started taking web dev seriously I have been designing plain websites for years.
http://www.abbanis.con I think you misunderstood me re: my CSS problems (which have been resolved) and my looking for a menu class i.e PHP. Menu Class as in OOP, Classes, Methods, Properties. And I have found a good PHP Menu Class in the mean time i.e. PHP Layers Menu. So I am not as ignorant as you think And my index.php could not “see” my .css files because they were not there. Just an oversight. But I am back on track - see and later Thank You and Cheers

Johan van Zyl

To you or to anyone getting serious about writing websites of whatever sort, I recommend a visit to W3C. Run your pages through the validator there, as this can save you from a lot of headaches down the road. And look through the wealth of information available on that site too, to jumpstart or polish your coding knowledge.


…is how I would recommend doing that tag. For the include paths, you can set multiple for it to look through such as:

include_path = .:/home/.xxxx/jvzuser/pear/php:./home/.xxxx/

Check out Gordaen’s Knowledge, the blog, and the MR2 page.


…is how I would recommend doing that tag.[/quote]
I disagree. This would be better:

<link rel="stylesheet" href="/layersmenu-demo.css" type="text/css" />Specifying a full URL results in more overhead.

Simon Jessey | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]

My problem was - I was under the impression that the CSS files were already in the same folder as the index.php, but they were not!. Now that they are - all is well!

Johan van Zyl

Good point. That depends on how big the tree ends up being, though the reason for putting it that way was to help eliminate other issues the original poster may have had and habit from back when (I think it was) Netscape 4 had problems with relative links for stylesheets. :slight_smile:

As a side note, there are advantages and disadvantages to each. For instance, a relative link is nice when testing locally and when the referencing file is not deep in the directory tree. Using an absolute link is nice when you have sites on different domains using the same stylesheet or when the referencing file is several folders deep and the css file is at the site’s root.

Check out Gordaen’s Knowledge, the blog, and the MR2 page.