1. Contributing Member
Join Date
Jan 2006
Posts
35

The formmail script indicates that in order to use templates you can
do
// ** OPTIONAL **
// Set TEMPLATEDIR to the directory on your server where template files are
// stored.
//
// If you want to specify "good_template", "bad_template" or "HTMLTemplate"
// in your forms, the templates must be found in the directory you specify
// below.
// This is a necessary step to prevent security problems. For example,
// without this measure, an attacker might be able to gain access to
// any file on your server.
//
// We recommend you set aside a particular directory on your
// server for all your templates.
//
// NOTE: on Windows servers, use '/' instead of '\' or double the
// '\' like this:
// "d:\\path\\to\\templates"
// or
// "d:/path/to/templates"
//
PHP Code:
 $TEMPLATEDIR = "\\wepp\\conf\\domains\\abc6464\\nep\\wwwroot\\formmail\\template";  3. Contributing Member Join Date Jan 2006 Posts 35 ## Re: Template directory linking Ok under the code for template directory I would put what you have indicated in the php code$TEMPLATEDIR = " \\wepp\\conf\\domains\\abc6464\\nep\\wwwroot\\formmail\\template";

inside of both my formmail and formmail badhandle script?

4. Valuable Member
Join Date
Jul 2005
Posts
175

yes, in both, formmail.php and fmbadhandler.php

but the path i've posted as "TEMPLATEDIR" is not exactly that which you can use
you have to change it to your server directory

- run it in your browser
- look after "_SERVER["DOCUMENT_ROOT"]" – it's rather at the end belonging to "PHP Variables" – or "_SERVER["SCRIPT_FILENAME"]"

"SCRIPT_FILENAME" quotes your exact path to the "phpinfo.php" file which you have uploaded just before
that's your path without the "phpinfo.php" at the end of it

after you have done this, you only have to quote it correctly with all the "\\" as described in formmail.php or like i've done in my example

that's it

5. Contributing Member
Join Date
Jan 2006
Posts
35

On a apache server are the slashes suppossed to be forward or backward? And do I use single or double slashes

6. Valuable Member
Join Date
Mar 2004
Posts
2,224

you want forwrd slashes - /

backslashes are just for windows

7. Valuable Member
Join Date
Jul 2005
Posts
175

Yep, I'm sorry. I forgot that I had configured mine for a windows server.

8. Active Member
Join Date
Jun 2006
Posts
4

- run it in your browser
- look after "_SERVER["DOCUMENT_ROOT"]" – it's rather at the end belonging to "PHP Variables" – or "_SERVER["SCRIPT_FILENAME"]"

When I run the phpinfo file, I cannot find any of these variables, nor is there a section for phpvariables... Am I doing something wrong or have I a server that does not support this?

I am using a free host..

JaX

9. Valuable Member
Join Date
Jul 2005
Posts
175

If you're using a free host I'd guess PHP might not be supported. At least most free hosts I know don't support it.

10. Active Member
Join Date
Jun 2006
Posts
4

Well it does say free php, mysql databases etc.. on the homepage, and my mails seem to be working fine.... I just cant use templates..

I believe I just am not getting the templatedir setting correctly...

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts