I am getting the following error for the first time: Smarty error: the $compile_dir 'templates_c' does not exist, or is not a directory.

Of course it is a directory because I have many compiled templates in it already. The only thing that is new is the template. Here is the code I am trying to put together for testing (only partially completed):
<?php
require('gpbc/setup.php'); //setup file with DB and Smarty setup info
require_once "globals.php";
$post_vars = StripSlashArray ($_POST);

Here's a tip: only create one Smarty object instance and setup that instance according to your environment/paths. You would then reference that one and only instance whenever you need to access Smarty and thereby ensure that you are always going to use a properly setup instance.

Here is an example using global var access. I actually suggest using a singleton, but this is fine to give you the idea.

Boots,
What do you mean by "singleton" in your comment? Why not use a GLOBAL var if it is going to be used in virtually every page?

Sure, you can use globals but it means a few dependancies that are hard to resolve. For example, your functions will have to assume that the global variable has a specific name and that it is properly initialized prior to being accessed via the function. It also increases the risk that 3rd party code (which may also use globals) will collide with your private code. There is also some snobbery about proper coding styles which suggest not using globals at all (for example, Java where they are not even possible) for the reasons above and also due to some compiler considerations in some languages. In interpreted PHP it is not too much of a big deal if you are willing to live with the coding style issues.

A singleton is a slighlty more advanced concept and relates to an object pattern that enforces a single instance of a class. ie: it gaurantees that whenever you request an instance of a specific class that only one instance is ever created; once created, all other requests for an instance of the class return a reference to the existing instance.

The following demonstrates the above example but with a singlton derived from a class that I use for such purposes.

It is a subtle difference. I have to include my "LAF_RT" class (which is very small) before this function is defined -- but I do that in my prepend.php so it is gauranteed to be available. The LAF_RT::Singleton() method call returns an object instance for the class "LocalSmarty" which is my custom extended Smarty class and it also ensures that once an instance is created, only references to that existing instance are returned. Note, though, that I don't have to pre-initialize the Smarty var or even load the Smarty class -- that only happens if it is actually used by code that is executed.

As always, you advice has proved invaluable. My homework now is to read-up on singletons and try to implement that feature next. I solved all my other "file" problems with your suggestions and as always close attention to detail.

I doubt that you get this ricklach since your post was from 2004 but on the slight chance you might I have the following question. I have very similar code to what you had but at the opening of the page and anytime when moving through the form I get a the following error "Undefined variable: new_array"