The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 3 of 3

Thread: PHP Error

  1. #1

    PHP Error

    I get an error when I try testing the FormMail from tectite.com.

    The instructions say:

    1. Edit this file and set TARGET_EMAIL for your requirements (near
    * line 246 in this file - replace "yourhost\.com" with your mail server's
    * name). We also strongly recommend you set DEF_ALERT (the next
    * configuration below TARGET_EMAIL).

    2. Install this file as formmail.php (or other name ending in .php)
    * on your web server.
    * Test alerts by using your browser to open a URL to the script:
    * http://www.yourhost.com/formmail.php?testalert=1
    * Alerts are the only way FormMail can tell you the details of
    * errors or faults.

    3. Create an HTML form and:
    * - specify a hidden field called "recipients" with the email address
    * of the person to receive the form's results.
    * - in the your form tag set the action attribute to
    * the formmail.php you uploaded to your web server


    Point 1:
    What I've done is the following:

    $TARGET_EMAIL = array(EMAIL_NAME."^myName@myDomainName\.com\.au$"" );

    /* Help: http://www.tectite.com/fmdoc/def_alert.php */
    define("DEF_ALERT","myName@myDomainName.com.au");

    Point 2:
    I uploaded the PHP file on my website server in a folder: /formtest/formmail.php

    Point 3:

    As suggested I added the hidden field in my form code:

    <form method="post" action="http://myDomainName.com.au/formtest/formmail.php" name="SampleForm">
    <input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUT H_TYPE,REMOTE_USER" />
    <!-- STEP 2: Put your email address in the 'recipients' value. Note that you also have to allow this email address in the $TARGET_EMAIL setting within formmail.php! -->
    <input type="hidden" name="recipients" value="myName@myDomainName.com.au" />
    <!-- STEP 3: Specify required fields in the 'required' value -->
    <input type="hidden" name="required" value="email: myName@myDomainName.com.au,realname:myName" />
    <!-- STEP 4: Put your subject line in the 'subject' value. -->
    <input type="hidden" name="subject" value="Sample FormMail Testing" />

    However after uploading the html and php and and try testing it, i get the following error?

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/myDomain/public_html/formtest/formmail.php on line 253

  2. #2
    PHP Code:
    $TARGET_EMAIL = array(EMAIL_NAME."^myName@myDomainName\.com\.au$""  ); 
    should be

    PHP Code:
    $TARGET_EMAIL = array(EMAIL_NAME."^myName@myDomainName\.com\.au$"  ); 
    (two quotes at the end)

    also see:
    Form mail script selection guide

  3. #3
    Prasanthmj,

    Your a champion...... cheers for that.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012