help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



Notes

When you store programs in cgi-bin, remember that separate CSS stylesheet files usually cannot be stored there. They must usually be in your public html folder.

(However if you are using embedded CSS within the <head> tag then you can reuse a CSS file in cgi-bin by using the FileOut() call.)

If using regular CSS files not embedded in head, then you can organize like:

  http://yoursite.com/cgi-bin/prog/prog.cgi
  http://yoursite.com/css/prog/prog.css
Rather than below, which will not work in general:
  http://yoursite.com/cgi-bin/prog/prog.cgi
  http://yoursite.com/cgi-bin/prog/prog.css
This is because cgi-bin is not for storing static CSS files or javascript .js files, unless you embed them in the output of the program with FileOut.

Cgi-bin cannot contain static css/java files that the client web browser would try to access as static files.

You could also organize your files like this:

  http://yoursite.com/cgi-bin/prog/prog.cgi
  http://yoursite.com/cgi-files/prog/prog.css
There are many ways to do it.

CGI Frustration

You may be frustrated with cgi-bin, since it puts this limit on your directory structure. It really does not take long to get used to.

As a side note: with interpretted PHP where files can be located anywhere, it is less secure than cgi-bin since people can find include files that you wouldn't necessarily want them to find.. so CGI isn't all that bad for being restrictive.. it has benefits. Your text files in cgi-bin that store data are hidden, such as SDS files and other config files.

Exceptions To The Rule

There are some server setups that allow any HTML file to be accessed in cgi-bin, or any cgi program to be opened in any directory. This means that the above notes do not apply to those servers with that setup. However it is recommended to use the standard cgi setup where cgi-bin is locked down so that your apps are portable to any limited cgi server. Most servers are the limited locked down cgi-bin type.

A server with unrestricted cgi-bin that allows html to be accessed anywhere, or cgi programs to be executed in any folder.. is less secure since people can view files that the cgi program rely on (if you didn't take precaution to secure them through htaccess). Therefore it is recommended you work with a server with restricted cgi-bin anyway.






lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505