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

Thread: Sample INI file

  1. #1
    Join Date
    Mar 2011
    Posts
    43

    Question Sample INI file

    I am planning to use the INI file to hide my real email address from bots.

    Does anyone has an INI file that I can copy and customize?

    In my experience, it's safer to customize an existing file than to create one from scratch.

    Thank you.

    Dr. T.

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

    Default Re: Sample INI file

    Everyone's is different according to their form. Did you view the examples on this page:

    http://www.tectite.com/fmhowto/inifile.php

    Did you try it and get an error? If so, post what you have in the INI file here.

    The other thing is to make sure that the $FORM_INI_FILE setting is correct. That should be the "server path" to the INI file. You can get the server path by running test alert:

    http://yourdomain.com/path-to-formmail.php?testalert=1 .

  3. #3
    Join Date
    Mar 2011
    Posts
    43

    Default Re: Sample INI file

    Dear Ginger,

    All I am looking for is something to get me started. That is, the first few lines. For example, I don't know if I have to use bracketed section names or what to put in them.

    I know how to define an email alias, re-configure the FornMail script, and change my form.

    Dr. T.

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

    Default Re: Sample INI file

    This is all you put in it (if all you want is to hide your email address.) Of course the INI file needs to be stored above the root, if you have access to that.

    Something like this should work:

    Code:
    [email_addresses]
    Fake = "you@yourdomain.com"

    Then, in your form, you'd put:

    HTML Code:
    <input type="hidden" name="recipients" value="Fake">
    If you don't want to use an email alias, you can also just put the recipients field in the INI file, which would eliminate the need to put the recipients field in the form itself:

    Code:
    [special_fields]
    recipients = "you@yourdomain.com"
    If you have multiple recipients, just separate them with a comma or define them using the cc or bcc in the special_fields section ... or you can create an alias that combines all of them.
    Last edited by ginger23; 23-Apr-2011 at 05:20 PM.

  5. #5
    Join Date
    Mar 2011
    Posts
    43

    Default Re: Sample INI file

    Dear Ginger,

    Thank you for helping me. It didn't work. :-(

    Here's the file:

    [email_addresses]
    my_email = dr.t.rod@p3pyramid.com

    Note: As stated in the documentation (INI Files), I added quotes.

    And, here's the error:

    Your form submission failed due to the following reason:

    The FormMail INI file 'http://hispanic-american.p3p-research.com/cgi-bin/formmail.ini' has a syntax error Our staff have been alerted to the problem. We apologize for any inconvenience.

    Dr. T.

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

    Default Re: Sample INI file

    Yes, you need quotes. Sorry I'm a bit brain dead the last few days.


    Are you creating the INI file in Notepad and transferring it in ascii (plain text) mode?

    I wouldn't put it in the cgi-bin. It seems I've seen that cause problems for people in the past. I would put it above the public_html directory.

    Sometimes I've seen that error message caused by a bad $FORM_INI_FILE path. What do you have for that?

    Also, in formmail.php you can try setting:
    Code:
    define("DB_SEE_INI",true);
    This is just for debugging purposes and will just display the contents of the INI file when you click submit. That is if it can find the INI file. Set it to false when the form is active.
    Last edited by ginger23; 23-Apr-2011 at 05:31 PM.

  7. #7
    Join Date
    Mar 2011
    Posts
    43

    Default Re: Sample INI file

    Dear Ginger,

    (1) I opened an .ini file from my computer in Notepad, changed it, remamed it, and saved.

    According to the ISP's File Manager, the File Type is ASCII text, with CRLF line terminators (Problem?).

    (2) For testing, I uploaded the file to the Public Directory, which is the directory for FormMail.php (I changed the path to the INI here).

    (3) The path is:

    $FORM_INI_FILE = "http://hispanic-american.p3p-research.com/formmail.ini";

    (4) I set DB_SEE_INI to true (in FormMail.php)

    (5) The error message received by email says:

    The following error occurred in FormMail:

    bad_ini

    **********

    Error=The FormMail INI file 'http://hispanic-american.p3p-research.com/formmail.ini' has a syntax error

    Dr. T.

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

    Default Re: Sample INI file

    Quote Originally Posted by Dr.T. View Post
    http://hispanic-american.p3p-research.com/formmail.ini
    That's not a server path. That's a url. Run test alert and check the server path for $DOCUMENT_ROOT. Then add /formmail.ini onto that.

  9. #9
    Join Date
    Mar 2011
    Posts
    43

    Default Re: Sample INI file

    Dear Ginger,

    Thank you for your reply. I apologize for my ignorance.

    I ran test alert. The email received showed:

    DOCUMENT_ROOT: /home3/wagner/public_html/hispanic-american (where FormMail is located

    FYI, home3 is the ISP's server, wagner is the account name, and hispanic-american is a subdomain in www.p3p-research.com).

    For testing, I will upload forrmmail.ini where formmail.php is located.

    Is the following the exact syntax?

    $FORM_INI_FILE="/home3/wagner/public_html/hispanic-american/formmail.ini";

    By the way, the ISP is using PHP v. 4.4.9, which according to Tectite's documentation, might require the syntax of formmail.ini to be different. You might recall my formmail.ini's file type is ASCII text, with CRLF terminators. In the past, emails received during testing did show there were "syntax errors" in formmail.ini.

    I am attaching the email received.

    Thank you.

    Dr. T.
    Attached Files Attached Files
    Last edited by Dr.T.; 24-Apr-2011 at 08:06 AM. Reason: Additional info.

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

    Default Re: Sample INI file

    Your server path now looks correct. I think CRLF is also the standard for email headers, although some email systems may require something different, but I don't think that's what the syntax error is about.

    Go ahead and give it a try with that server path.

    ginger

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sample HTML Form Using FormMail
    By russellr in forum FormMail
    Replies: 1
    Last Post: 21-Mar-2007, 06:49 AM
  2. Sample Multi-Page Form
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-Apr-2005, 03:18 AM
  3. Sample Auto Responder Form & Template
    By russellr in forum FormMail
    Replies: 0
    Last Post: 04-Sep-2004, 10:15 PM
  4. Good Template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 31-Aug-2004, 04:05 AM
  5. Error template - a sample for you to use
    By russellr in forum FormMail
    Replies: 0
    Last Post: 18-May-2004, 03:38 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
  •