Results 1 to 2 of 2

Thread: INI File Problems

  1. #1
    Join Date
    Apr 2008

    Default INI File Problems

    Great FormMail script. I'm trying to get it working with an .ini file but am having trouble. PHP version is 4.3.10 on a Windows shared server, FormMail v8.05.

    Script works fine without the ini file, but plugging it in creates errors. My somewhat uninformed guess is a pathing problem to the ini file.

    I inserted the line ini_set("sendmail_from",""); near the beginning of the php file in order to get my server to send email. Seems to work okay with that. I don't know if I should be fooling around with INI_SET_FROM. All its ramifications and conditions make my head spin at first glance, but I'm sure I could wade through if necessary. That line seems to be getting me through as far as receiving basic form email without the ini file.

    I'm using the supplied sampleform.htm for testing and only changing the "recipients" value as needed from an actual email address to a referenced alias in the ini file. A real address and not using the ini file comes through just fine, but upon referencing an alias, and creating and pathing an ini file I'm getting errors. Cutting out the ini file again restores success.

    Attempting to use the ini file generates the following in the form:
    An error occurred while processing the form .
    Our staff have been alerted to the error .
    We apologize for any inconvenience this error may have caused.
    Your form submission was processed by (8.05)
    It also generates a script error email with the following:
    The following error occurred in FormMail:
    Error=The form has an internal error - no valid recipients were specified
    My ini pathing line is: $Form_INI_FILE = "/www/forms/abc.ini"; with the original default line commented out.

    The ini file contains:
    me = "" matches $TARGET_EMAIL = array("^me@mysite\.com$"); and <input type="hidden" name="recipients" value="me" /> was substituted in the html file. With the ini file path enabled in the script and the alias inserted in the form I get the above errors.

    Setting define("DB_SEE_INI",true); I get the message:
    The following settings were found in the file '':
    My root files are in "www" on the shared server. I've tried many pathing variants, all with the same results:

    With script and ini in the root directory (/www/):

    With script and ini in /forms/:

    Also complete absolute path just for kicks:

    I really don't like the idea of a live email floating about in a form, even with AT_MANGLE so I really need the ini file to work. I wish it could be hardcoded directly into the script and be done with it. I'm hoping someone has some ideas on what may be wrong. Maybe I've missed something stupid along the way.

    Thanks in advance.

  2. #2
    Join Date
    May 2008

    Default Re: INI File Problems

    Hi Max,

    I am no formmail 'expert', but I'll have a go! Firstly I have never used the ini_set function in formmail. As all my forms collect the email address of the sender, mine automatically defaults to their email address. That way when you get the email you can hit reply and their email is auto populated in the to field..... but any hoo I'm off the subject of your ini file.

    I see you have set your $TARGET_EMAIL file and looks ok. VERY important to remember to do this for every alias address you want in your ini file. I've endured many hours of frustration testing forms when I started using formmail by simply forgetting to add my address here too. Forgetting this also gives you the same no_valid_recipients error even if your ini is set up correctly.

    Where I think you problem is is the path to your ini file. Depending on your web host and how your site is set up, the path can be very different from what you actually think. The $FROM_INI_FILE needs to be the full pathname from the ROOT.

    Like you I origianally thought (and using your example), well that must be /www/forms/abc.ini.

    But hosting service's set up means that my path is actually /var/virtual/web/w6529/html/abc.ini

    You can usually find out the true Root Directory (and path) of where your formmail script is and use it as a basis. This can be done by putting the following into your web browser (use the proper address for where ever you have your form mail script living.

    It will then send you an email showing the real path to your ROOT directory and therefore the path you should include in your $FROM_INI_FILE.

    For added security I ALWAYS put my ini files and templates in a folder on my server that people won't see in the URL address bar of their web browser..... e.g. rather than using the directory forms you might want to use a folder say, all hidden stuff.

    for example my $FORM_INI_FILE looks like this:
    /var/virtual/web/w6529/subdomain/testingsite/all hidden stuff/postoffice.ini

    I really hope this helps! If not post me back.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. problems to display template.
    By minorarias in forum FormMail Subscription Support
    Replies: 3
    Last Post: 31-Jan-2005, 09:23 PM
  2. mail_options and template problems
    By middric in forum FormMail Subscription Support
    Replies: 1
    Last Post: 09-Jan-2005, 08:29 PM
  3. Template problems
    By msoucy in forum FormMail Subscription Support
    Replies: 8
    Last Post: 03-Dec-2004, 04:31 AM
  4. csv file problems
    By Badnet in forum FormMail Subscription Support
    Replies: 2
    Last Post: 12-Nov-2004, 02:06 AM
  5. Badhandler Problems
    By Jacob in forum FormMail Subscription Support
    Replies: 3
    Last Post: 17-Aug-2004, 08:11 PM


Posting Permissions

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