Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Cannot open template 'fmtemplates/errorTemplate.php':

  1. #1
    Join Date
    Oct 2008
    Location
    Gold Coast Australia
    Posts
    18

    Default Cannot open template 'fmtemplates/errorTemplate.php':

    Hi,

    I have set up FormMail.php and fmbadhandler. Great script!

    Just one problem. When i submit a form I get the following error message - even though the path is correct.

    ----------------------------------
    Cannot open template 'fmtemplates/errorTemplate.php': fopen(fmtemplates/errorTemplate.php) [function.fopen]: failed to open stream: No such file or directory
    -----------------------------------

    Any suggestions?

    Abby

  2. #2
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    See this post about setting $TEMPLATEDIR:

    http://www.tectite.com/vbforums/showthread.php?t=3309

    I'm not sure, but if you're using a php page as a template, you might need to use $TEMPLATEURL "instead of" $TEMPLATEDIR, in which case the setting would be:

    $TEMPLATEURL = "http://www.yourdomain.com/fmtemplates";

    ginger

  3. #3
    Join Date
    Oct 2008
    Posts
    5

    Question Re: Cannot open template 'fmtemplates/errorTemplate.php':

    Hi,

    I'm having a similar problem. I configured formmail and it was working properly sending the default plaintext form results via email.

    I have created an HTML template and uploaded it as specified in the How-To Guide to the "fmtemplates" folder I created on the site root.

    I think the trouble is that I haven't correctly specified the directory in FormMail (the $TEMPLATEURL or $TEMPLATEDIR setting). The example directory is confusing and all the various methods I've tried are not working (I get the plaintext email with an error stating the $TEMPLATEURL needs to be defined).

    Does anyone know, what the proper format for specifying the template URL or directory is? For example, if the site is http://www.mysite.com and the directory is "fmtemplates" I am using the url http://www.mysite.com/fmtemplates/

    Should I leave off the http:// or use backward slashes instead? Anyone else experiencing this problem?

    Any help would be hugely appreciated.... Thanks, Karisma

  4. #4
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    You want to leave the trailing slash off. Some hosts, however, won't allow opening a page like that with php (using the fopen command), so it's often best to use $TEMPLATEDIR.

    If using $TEMPLATEDIR, you need to know the server path to your document root and you can get this by running a test alert. There are many examples in this forum, including this one:

    http://www.tectite.com/vbforums/showthread.php?t=3275

  5. #5
    Join Date
    Oct 2008
    Posts
    5

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    Hi Ginger,

    Thanks so much for the prompt response. I have tried leaving off the trailing slash on the $TEMPLATEURL and it still isn't working.

    I think I might need to use the $TEMPLATEDIR setting instead, I reviewed the advice you gave on that link about running a testalert but that is giving me a 404errror (page not found).

    The html template is viewable online at: http://www.rinsurance.net/fmtemplates/GLResults.html

    Any other suggestions? Thanks again for your help!

  6. #6
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    Sorry, I should have mentioned that the example I gave needs to be adjusted to suit the path to YOUR script on YOUR domain, and using whatever YOU named the script. So if you named it formmail.php and you had it in the root directory of your domain it would be:

    http://www.yourdomain.com/formmail.php?testalert=1

  7. #7
    Join Date
    Oct 2008
    Posts
    5

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    Ok, here's what it should be on our server:

    http://www.rinsurance.net/cgi-bin/Te...hp?testalert=1

    I'm getting a 500 Error (Internal Server) when I try to run the test alert. I know the path to the files, not sure what test alert would show that's different?

    The path to the script is: http://www.rinsurance.net/cgi-bin/TectiteFmail.php

    The path to the template is: http://www.rinsurance.net/fmtemplates/GLResults.html

    Do I need to move the "fmtemplates" directory into the cgi-bin with the script?

    Thanks again for all the help.

  8. #8
    Join Date
    Oct 2008
    Posts
    5

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    By the way, I tried moving the "fmtemplates" folder into the cgi-bin and adjusting the path in the script to reflect that change.... didn't seem to make a difference, it still results in the same error message (received via the plaintext email).

    "The following error occurred in FormMail :
    You must set either TEMPLATEDIR or TEMPLATEURL in formmail.php before you can specify templates in your forms."

    I'm running out of ideas! Anything else I can try? Thanks!

  9. #9
    Join Date
    Oct 2008
    Location
    Gold Coast Australia
    Posts
    18

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    Hi,

    I just solved the problem.

    The $TEMPLATEDIR settings were not right.

    You need to get the path to your document root by running testalert:

    http://www.yourdomain.com/path-to-fo...hp?testalert=1

    This will send you an email to the address set in $DEF_ALERT that shows the path to your document root. From there you can add fmtemplates to that path for $TEMPLATEDIR.


    Now my path looks like /home/servername/public_html/fmtemplates

    Rather than http://www.rejoiceinlife.com/fmtemplates

    Not sure if i should update $TEMPLATEURL

    Anyway error page now works.

    Thanks guys for your input.


    Abby
    NLP Life Coach
    www.abbyeagle.com

  10. #10
    Join Date
    Oct 2008
    Location
    Gold Coast Australia
    Posts
    18

    Default Re: Cannot open template 'fmtemplates/errorTemplate.php':

    Hi,

    I just solved the problem.

    The $TEMPLATEDIR settings were not right.

    You need to get the path to your document root by running testalert:

    http://www.yourdomain.com/path-to-fo...hp?testalert=1

    This will send you an email to the address set in $DEF_ALERT that shows the path to your document root. From there you can add fmtemplates to that path for $TEMPLATEDIR.


    Now my path looks like /home/servername/public_html/fmtemplates

    Rather than http://www.rejoiceinlife.com/fmtemplates

    Not sure if i should update $TEMPLATEURL

    Anyway error page now works.

    Thanks guys for your input.


    Abby
    NLP Life Coach
    www.abbyeagle.com

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. Advanced Error Handling - failed to open stream: Connection timed out
    By Antonimo in forum FormMail Subscription Support
    Replies: 5
    Last Post: 31-Aug-2005, 06:52 AM
  3. FornNail Instead to send mail, open formmail.php in browser
    By Alvise in forum FormMail Subscription Support
    Replies: 2
    Last Post: 23-Aug-2005, 07:52 AM
  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

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
  •