+ Reply to Thread
Results 1 to 3 of 3

Thread: php includes not showing up in good/bad templates

  1. #1
    Join Date
    Apr 2005
    Posts
    7

    Default php includes not showing up in good/bad templates

    First off, thank you for letting me use formmail.php. The site in question is a "fake" site created for a web class. I will be adding formmail.php to my other "real" sites (once I get it squared away) and will certianly give credit where credit is due with the provided link.

    I am having a problem with my good/bad templates. I am a novice with php so go easy on me.

    What was working/ what I need:
    I am tying to display the good/bad info within the normal layout of my site. I added the php includes for the top and bottom layout of my site into the good/bad templates. It was displaying the good/bad info correctly within the normal site layout.

    What I did:
    I was trying to set up the fmbadhandler and must have goofed something up. I ditched fmbadhandler and associated steps (I hope) to try and start from scratch. But the problem remains.

    What happens:
    Now, my includes are ignored and the good/bad info is displayed alone.

    Clues:
    When I was first trying to get the includes working, I would get error messages that the included files could not be found. Once I corrected the path to the included files the problem was solved and the good/bad info displayed correctly within my site layout.

    Since the includes stopped working, I change the path to the included files to a bogus path to see if there would be an error. Now there isn't even an error stating that the included files can't be found (as was the case at first). It seems as though the includes are being ignored/skipped somehow. I can alter the basic text in the good/bad templates and it will show up in the browser, so I know that formmail knows where the templates are. It's just the includes that are missing.

    My form has:
    Code:
    <input type="hidden" name="bad_template" value="ERRORformmail.php" />
    <input type="hidden" name="good_template" value="OKformmail.php" />
    formmail.php has:
    Code:
    $TEMPLATEDIR = "formmailtemplates";
    and
    Code:
    $TARGET_URLS = array();
    The includes are at the very top and bottom of the good/bad templates.
    at the very top is:
    at the very bottom is:
    Any help or advice would be great!
    Thanks again for formail.php.
    Link to form:
    http://www.chc11.info/OR/contactus.php
    Last edited by snodart; 02-Apr-2005 at 08:46 AM. Reason: missing link

  2. #2
    Join Date
    Dec 2003
    Posts
    3,900

    Default Re: php includes not showing up in good/bad templates

    Hi,

    First off, thank you for letting me use formmail.php.
    You're welcome.

    What you've got is a dynamic site. Pure HTML pages are static. By using PHP for a page, the actual HTML page is generated dynamically by the web server (e.g. Apache) executing the PHP script through the PHP processor.

    In order to get this to happen for your templates, you need to use FormMail's $TEMPLATEURL setting instead of $TEMPLATEDIR.

    $TEMPLATEDIR causes FormMail to just open and read the template files like text. Apart from the $variable substitutions that FormMail does, the results are completely static.

    $TEMPLATEURL, however, causes FormMail to open the templates like a web browser does; so they are processed in any way that's appropriate by the web server. For PHP pages, they are processed by the PHP processor.

    After that processing, FormMail then does the $variable substitutions.

    So, in short, I think you just need to set $TEMPLATEURL (probably to "http://www.chc11.info/OR/formmailtemplates") instead of $TEMPLATEDIR and you'll be fine.

    BTW, you seem to have an error in OKformmail.php - open it in your browser to see: http://www.chc11.info/OR/formmailtem...OKformmail.php

    Hope that helps. Let me know if you need anything else.

    Good luck with your webclass.

    PS Thanks for the dollars - much appreciated!
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Apr 2005
    Posts
    7

    Default Re: php includes not showing up in good/bad templates

    Got it. it works like a champ now. That was too easy.
    It is amazing what a day of staring at a screen can do to the mind . Now it's back to fmbadhandler. Thanks for the response. Great site, great forum, and great work.

    Thanks again!

+ 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. submitted form data not showing
    By JohnB in forum FormMail Subscription Support
    Replies: 4
    Last Post: 14-Jun-2005, 06:50 PM
  2. How To Pick a Good PHP Hosting Company
    By russellr in forum FormMail Subscription Support
    Replies: 0
    Last Post: 09-Mar-2005, 11:14 PM
  3. New Server - Templates sent as plain text
    By Anubis in forum FormMail Subscription Support
    Replies: 10
    Last Post: 19-Jan-2005, 11:30 AM
  4. encoder and good template
    By dunn123 in forum FormMailEncoder/Decoder
    Replies: 3
    Last Post: 13-Jan-2005, 12:36 AM
  5. Good Template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 31-Aug-2004, 05:05 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