+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Template directory linking

  1. #1
    Join Date
    Jan 2006
    Posts
    35

    Default Template directory linking

    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"
    //
    $TEMPLATEDIR = ""; // directory for template files; empty string
    // if you don't have any templates



    My question would be how exactly are u supposed to specify the path to the directory. Is it http://yoursite.com/fmtemplates or is it something else

  2. #2
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Template directory linking

    yep

    i.e.
    PHP Code:
    $TEMPLATEURL "http://yourhost/tectite/template/"
    PHP Code:
    $TEMPLATEDIR "\\wepp\\conf\\domains\\abc6464\\nep\\wwwroot\\formmail\\template"

  3. #3
    Join Date
    Jan 2006
    Posts
    35

    Default 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. #4
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Template directory linking

    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

    to get your correct directory on your server:
    - upload the attached "phpinfo.php" to your "template" directory on your server
    - 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
    Attached Files

  5. #5
    Join Date
    Jan 2006
    Posts
    35

    Default Re: Template directory linking

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

  6. #6
    Join Date
    Mar 2004
    Posts
    2,224

    Default Re: Template directory linking

    you want forwrd slashes - /

    backslashes are just for windows

  7. #7
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Template directory linking

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

  8. #8
    Join Date
    Jun 2006
    Posts
    4

    Default Re: Template directory linking

    Quote Originally Posted by asket
    to get your correct directory on your server:
    - upload the attached "phpinfo.php" to your "template" directory on your server
    - run it in your browser
    - look after "_SERVER["DOCUMENT_ROOT"]" – it's rather at the end belonging to "PHP Variables" – or "_SERVER["SCRIPT_FILENAME"]"
    Hi Asket, thanks so much for your reply to my query..

    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..

    Thanks a lot in advance..
    JaX

  9. #9
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Template directory linking

    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. #10
    Join Date
    Jun 2006
    Posts
    4

    Default Re: Template directory linking

    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...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. formmail with active directory?
    By mcameron in forum Community Support
    Replies: 1
    Last Post: 09-Jan-2007, 10:38 PM
  2. Replies: 4
    Last Post: 08-Jan-2007, 01:25 PM
  3. Unable to create check file - in proper directory (not tmp)
    By chrisdisregard in forum Community Support
    Replies: 3
    Last Post: 25-Sep-2006, 01:22 AM
  4. What is the purpose of the security directory?
    By mikie in forum FormMail Subscription Support
    Replies: 0
    Last Post: 04-Jul-2005, 06:52 AM
  5. Save to CSV file not working, Directory path
    By mkw in forum FormMail Subscription Support
    Replies: 3
    Last Post: 02-Oct-2004, 12:28 AM

Bookmarks

Posting Permissions

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