Using Sub-Directories with the Advanced Email Script

If you have lots of pages on your site then you probably have some sort of directory structure in place to keep the images and other page components separate from the page source files themselves. If you are going to use my advanced email script then you may not want to place the include files in the same directory as the main email script file email.php.

Puting the included files into a separate sub-directory is simple for the ones that you attach yourself using the include form field. All you have to do in this case is to include the directory name onto the front of the filename eg. "inc/myinclude.php".

You can shift the efopts.php file into a sub-direcory just as easily since you include it yourself in the main include file (myinclude.php in the above example). It will be assumed to be in the same directory as that include file by default. If it isn't then you will need to include the correct directory path in the front of the include statement eg "../efopts.php" if the file is in the parent directory to the one containing your include file.

The only other include files that are left are efunc.php and eproc.php which are called directly by email.php. To move these file to a sub-directory you will need to make a minor change to email.php. The statements that you are looking for are the last two lines which are the include statements to include the function file and processing file. All that you need to do is to change these statements to provide the path on the front of the file names.


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow