Results 1 to 7 of 7

Thread: Template PHP Processing

  1. #1
    Join Date
    Dec 2008
    Location
    Davenport, Iowa USA
    Posts
    29

    Default Template PHP Processing

    It appears that FORMMAIL creates a proper HTML page from the template supplied but that page does not go thru the PHP processor prior to being sent to the client browser. Is there a way to have the template run thru the PHP processor prior to going to the client browser?

  2. #2
    Join Date
    Dec 2008
    Location
    Davenport, Iowa USA
    Posts
    29

    Default Re: Template PHP Processing

    Ok. Again, read the documentation before posting! I'm supposed to use TEMPLATEURL instead of TEMPLATEDIR. So, that's what I did; I set the TEMPLATEDIR setting in FORMAIL.PHP to the default value and used that original setting for TEMPLATEURL. However, I got the following errors in seperate messages from FORMMAIL:

    The following error occurred in FormMail :
    template_failed
    **********
    Error=Failed to process template "scoring_prepost_conf.php"


    The following error occurred in FormMail :
    Socket error 0: : include() [<a href='function.include'>function.include</a>]: Failed opening '../templates/fmhookprefinish.inc' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear')

    The following error occurred in FormMail :
    Socket error 0: : Undefined index: q8

    and finally:
    The following error occurred in FormMail :
    Socket error 0: : include() [<a href='function.include'>function.include</a>]: Failed opening '../templates/fmhookprefinish.inc' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear')

    I have no clue what any of this means and need help. Thanks.

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

    Default Re: Template PHP Processing

    Hi,

    It looks like you set $HOOK_DIR.

    You don't want that set unless you're using the hook system.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  4. #4
    Join Date
    Dec 2008
    Location
    Davenport, Iowa USA
    Posts
    29

    Default Re: Template PHP Processing

    Russell:

    Yes, I have a hook set (fmhookpreemail.inc) to remove CR / LF from several fields:
    <?
    $aRawDataValues["comments"] = str_replace("\r\n"," ",$aRawDataValues["comments"]) ;
    $aRawDataValues["other_names"] = str_replace("\r\n"," ",$aRawDataValues["other_names"]) ;
    $aRawDataValues["familiar"] = str_replace("\r\n"," ",$aRawDataValues["familiar"]) ;
    $aRawDataValues["co_chairs"] = str_replace("\r\n"," ",$aRawDataValues["co_chairs"]) ;
    $aRawDataValues["previous_experience"] = str_replace("\r\n"," ",$aRawDataValues["previous_experience"]) ;
    $aRawDataValues["reasons"] = str_replace("\r\n"," ",$aRawDataValues["reasons"]) ;
    $aRawDataValues["q7"] = str_replace("\r\n"," ",$aRawDataValues["q7"]) ;
    $aRawDataValues["q8"] = str_replace("\r\n"," ",$aRawDataValues["q8"]) ;
    ?>

    If there's another way to do this without using the hook, please advise. My other question would be why would these two features be dependent on each other? fmhookpreemail.inc happens to be in the same directory as my templates. If I should use a different directory for the hook, please advise. Thanks much for your help.

    Steve Darling

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

    Default Re: Template PHP Processing

    Hi,

    Nothing wrong with using the Hook System, but this error:
    Failed opening '../templates/fmhookprefinish.inc' for inclusion
    indicates you've set HOOK_DIR incorrectly.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  6. #6
    Join Date
    Dec 2008
    Location
    Davenport, Iowa USA
    Posts
    29

    Default Re: Template PHP Processing

    Russell:

    Ok. Thanks for the quick response. As I mentioned before, I was using the TEMPLATEDIR and had that set to my template directory. I do have the hook directory also set to the same directory. But I'm not using fmhookprefinish.inc at all, only fmhookpreemail.inc and with that configuration everything is working just fine. When I change to use TEMPLATEURL pointing at the same template directory and TEMPLATEDIR set to the default, I get the errors listed previously. So, with TEMPLATEDIR set, works fine. With TEMPLATEURL set, it fails. No other changes to the configuration. Still confused. Is there anything else I can share with you to help? Thanks for any assistance.

    Steve Darling

  7. #7
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Template PHP Processing

    Hi,

    Changing from TEMPLATEDIR to TEMPLATEURL will not affect Hook file processing.

    So, getting an error about hook files when making that change makes no sense. My guess is you updated the wrong file and uploaded changes you didn't want to include.

    If you need hands on assistance with this, please subscribe for support.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Template .PHP File
    By philsnow in forum Community Support
    Replies: 2
    Last Post: 10-Oct-2013, 11:45 AM
  2. Advance template with other standard php
    By Elso in forum FormMail Subscription Support
    Replies: 2
    Last Post: 13-Mar-2011, 10:48 PM
  3. PHP in the error template
    By davidjeanneret in forum Community Support
    Replies: 1
    Last Post: 15-Oct-2010, 10:15 AM
  4. Formmail.php processing time w/ FastCGI
    By slands10 in forum Community Support
    Replies: 0
    Last Post: 28-Mar-2008, 02:58 PM
  5. PHP Template - if then elseif statements
    By ksawic in forum Community Support
    Replies: 0
    Last Post: 28-Mar-2006, 08:41 PM

Tags for this Thread

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
  •