Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Failed to open template

  1. #11
    Join Date
    Apr 2008
    Posts
    11

    Default Re: Failed to open template

    Quote Originally Posted by russellr View Post
    If you use a URL you should use TEMPLATEURL not TEMPLATEDIR.

    If you use a directory/folder path, you should use TEMPLATEDIR.
    I get that. And that's what I ended up doing. (Using TEMPLATEURL)

    Quote Originally Posted by russellr View Post
    I've just re-read the documentation for TEMPLATEDIR and TEMPLATEURL. I'm not sure how we can improve this to make it clearer.
    Well, something is not clear. Because I set up TEMPLATEDIR = "/formhandlertemplates";, and I read that as a folder path to formhandlertemplates in the root directory for the domain, and that is where my templates are. When I changed it to TEMPLATEURL = "http://cohase.org/formhandlertemplates"; it worked fine. I see those as addressing the same location. In fact the error I got, Failed to open template "/formhandlertemplates/infoPlain.txt", seems to confirm that it was looking in the place I intended, just not finding it. Am I missing something here?

    Quote Originally Posted by russellr View Post
    Well, I certainly don't make a living from the little bit of subscription support we get. It just helps recoup some of the cost of providing genuine support.
    I get this Russell. Clearly I was frustrated because I tried to code it according to the instructions and I couldn't get it to work. Nor could I get an answer to my query. I still have no clue how I could define TEMPLATEDIR any differently than I did. I know there weren't any typos, because the messages and code fragments in my original message were copied and pasted to the forum.

    So we have four possible scenarios:
    1. I have a fundamental lack of understanding about coding folder paths.
    2. The documentation is incorrect.
    3. I badly misread the documentation.
    4. The script fails when using TEMPLATEDIR.

    Overall I like this script. A lot. And James was able to point me in the direction of a workaround. Thank you, James. That said, I am a stickler for resolving things. If scenario 1 or 3 is correct, I would like to know why so I can avoid doing that again. If scenario 2 or 4 is correct, then I would hope that situation could be corrected so nobody else spins their wheels like I did.

    Quote Originally Posted by russellr View Post
    Perhaps we should write bad documentation, and have buggy software, and then force people to pay to get any help.
    Now, now. Except for the fact that my original post went totally unanswered, none of the above should be taken as criticism. As I said, if it's on me, I just want to know so I can understand in the future. If it's a bug, they happen. I get that. I write code myself, just not php.

    Thanks,

  2. #12
    Join Date
    Feb 2008
    Posts
    149

    Default Re: Failed to open template

    I'm with Paul. Something about TEMPLATEDIR seems a little off-kilter. But MULTIFORMDIR works fine.

    Or maybe I've got mush-brain.

    When I do the testalert, I get this:

    DOCUMENT_ROOT: /kunden/homepages/1/d88448737/htdocs
    REAL_DOCUMENT_ROOT: /kunden/homepages/1/d88448737/htdocs

    So I set MULTIFORMDIR to:
    $MULTIFORMDIR = "/kunden/homepages/1/d88448737/htdocs/multiformdir";

    Works great.

    Then I set TEMPLATEDIR to:
    $TEMPLATEDIR = "/kunden/homepages/1/d88448737/htdocs/form_templates";

    And it fails.

    What am I missing?
    James Ivey
    Interested in calligraphy?
    www.iampeth.com

  3. #13
    Join Date
    Apr 2008
    Posts
    11

    Default Re: Failed to open template

    I want to add the results of another test. cohase.org is an add-on domain under CP (ControlPanel). (customsupport.com/public_html/cohase.org) Putting the templates folder at the root of customsupport.com does not fix it. Just thought I'd try that.

  4. #14
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Failed to open template

    Hi,

    Quote Originally Posted by paul.hunt View Post
    Because I set up TEMPLATEDIR = "/formhandlertemplates";, and I read that as a folder path to formhandlertemplates in the root directory for the domain,
    '/' is almost certainly not the root directory for the domain.

    Using testalert, you can find the full path - it's usually DOCUMENT_ROOT.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #15
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Failed to open template

    Hi,

    Quote Originally Posted by Jamesiv1 View Post
    When I do the testalert, I get this:

    DOCUMENT_ROOT: /kunden/homepages/1/d88448737/htdocs
    REAL_DOCUMENT_ROOT: /kunden/homepages/1/d88448737/htdocs

    So I set MULTIFORMDIR to:
    $MULTIFORMDIR = "/kunden/homepages/1/d88448737/htdocs/multiformdir";

    Works great.

    Then I set TEMPLATEDIR to:
    $TEMPLATEDIR = "/kunden/homepages/1/d88448737/htdocs/form_templates";

    And it fails.

    What am I missing?
    OK, so "/kunden/homepages/1/d88448737/htdocs" is your document root, and you're right it makes no sense that MULTIFORMDIR should work and TEMPLATEDIR doesn't.

    So, I'd be checking that you've typed "form_templates" correctly. and that that directory has full access permissions (rwxr-xr-x).

    The last thing to check is that your template name is in fact correct and that it has rw-r--r-- access permisions).

    The alert message for the failure should give some clues.

    James, contact me via PM or email if you need further assistance (I'm more than happy to give you some free support in recognition of all the help you've given other people).
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  6. #16
    Join Date
    Feb 2008
    Posts
    149

    Default Re: Failed to open template

    Will do Russell. Thanks a bunch.
    James Ivey
    Interested in calligraphy?
    www.iampeth.com

  7. #17
    Join Date
    Jan 2009
    Posts
    6

    Default Re: Failed to open template

    Hi

    My document root path is similar to James Ivey's, and I also can't get TEMPLATEDIR to work. Actually, TEMPLATEURL isn't entirely successful either.

    http://am-eic.net/html/form.php

    Here's what I get from testalert:

    DOCUMENT_ROOT: /kunden/homepages/nn/string/htdocs
    SCRIPT_FILENAME: /kunden/homepages/nn/string/htdocs/html/fogtecformproc.php
    PATH_TRANSLATED: /kunden/homepages/nn/string/htdocs/html/fogtecformproc.php
    REAL_DOCUMENT_ROOT: /kunden/homepages/nn/string/htdocs/html

    The folder I would prefer to use for the templates is a subfolder called "tectemplates" hanging off the html folder. Currently, I have a tectemplates folder hanging off the root, as well. Same error either way.

    If I put in a path for TEMPLATEDIR, I get the "failed to open stream" message and a CGI-Mailer email containing the data submitted on the form.

    If I take out the TEMPLATEDIR and put in a path for TEMPLATEURL, such as "http://www.am-eic.net/html/tectemplates", the script finds the template, but the submitted data doesn't make it into the message. The fields are all blank.

    Here's my template:

    Request for appointment


    Name: $realname

    Email: $email

    Phone: $telephone

    Where: $where


    As per Russell's suggestion, I've checked the permissions on both file and folder. And I've checked and rechecked the file name and the mail_options value.

    Please, can anyone tell me what I'm doing wrong? I've been trying to work this thing out off and on for the last two weeks.

    Thanks in advance.
    Allison

  8. #18
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Failed to open template

    Hi,

    If your tectemplates folder is inside the html folder, then your $TEMPLATEDIR setting should be:

    Code:
    $TEMPLATEDIR="/kunden/homepages/nn/string/htdocs/html/tectemplates";
    The reason the submitted data doesn't make it into the message is because you've spelled the field names all lower case, while the form specifies them as "Realname, Email, Telephone", etc.

    realname and email are "special fields" and should be defined in lower case in the form so that the name and email address can be used in the email header (unless you're using derive_fields, which is another topic.)

    Also, in your mail_options field, you specify your template as "plain.txt", but browsing to that file redirects you to a file called "Plain.txt" (capitalized). I would either rename that file to be lowercase, or change it to "Plain.txt" in the mail_options tag.

    ginger

  9. #19
    Join Date
    Jan 2009
    Posts
    6

    Thumbs up Re: Failed to open template

    Thank you, thank you!! I would never have looked for the capitalization. That was Windows being helpful again.

    Happily, TEMPLATEURL is now working properly. When I put the path back in the script for TEMPLATEDIR , I started getting oops.html instead of thanks.html when I clicked Submit.

    But at least I am getting emails from the form using the template, and for that I'm very grateful.

  10. #20
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Failed to open template

    Glad $TEMPLATEURL is now working.

    When using $TEMPLATEDIR, are you getting any error messages to the email set in DEF_ALERT?

    You might want to set up Advanced Error Handling so that you get more specific feedback about errors:

    http://www.tectite.com/fmhowto/adverror.php

    Also, in your form you've specified good_url and bad_url as "thanks" and "oops" rather than the complete file names ("thanks.html" and "oops.html"). I would think that would cause problems.

    ginger

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Failed to open CSV file
    By jibber in forum FormMail Subscription Support
    Replies: 6
    Last Post: 15-Sep-2005, 01:26 AM
  2. Error=Failed to send email [M94]
    By colinjack in forum FormMail Subscription Support
    Replies: 21
    Last Post: 26-Jul-2005, 11:23 AM
  3. Upgrade failed
    By ptr in forum FormMail Subscription Support
    Replies: 1
    Last Post: 21-Jan-2005, 10:17 PM
  4. Can error page open in new window leaving original
    By Rezults in forum FormMail Subscription Support
    Replies: 3
    Last Post: 19-Nov-2004, 01:22 AM
  5. William,Failed to send email.
    By shama07 in forum FormMail Subscription Support
    Replies: 1
    Last Post: 31-Jan-2004, 03:08 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
  •