Advanced Contact Form

Started by Deprecated, September 26, 2008, 06:15:53 PM

Previous topic - Next topic

Deprecated

Link to Mod

Obsolete

Deprecated

Please be advised that this mod package has been updated as follows:

Version 1.01 (Sept. 27, 2008) added English UTF-8 language strings.


Deprecated

I had originally intended to make my contact form AJAX but I decided to evolve my project as far as I could before adding in the AJAX technology. When I had the contact form working as good as it could, when I had added what I figured would be enough options to please everybody's preferences, only then did I look at what it would take to add AJAX.

When I saw how well my contact form works without AJAX, when I considered how much additional work it would be to add AJAX, and when I considered that probably contact forms aren't used that often anyway, so any bandwidth savings would probably result in only slightly improved speeds and any bandwidth costs would be improved by the AJAX only by a negligible amount.

The only reason I could think of to add AJAX would be to make this the Ultimate Contact Form rather than the Advanced Contact Form. In fact I expect to get smart on AJAX pretty soon, and one of the first things I'll do is probably come back and add AJAX to this contact form. And I'll rename it the Ultimate Contact Form for SMF 2.0. :)

So make that definite "maybe" that I'll be adding AJAX sometime soon! :) Probably after I get some more AJAX smarts than I have at present. :)


Michael Kopka

i integrated the mod in my board but for testing it always says the email adress is invalid. i tried with some different ones. whats wrong with it.

here my board: www.autotrac.org [nofollow]
My SMF: AutoTrac.org [nofollow]

Deprecated

Are you running under Windows? Please describe your configuration.

Michael Kopka

My SMF: AutoTrac.org [nofollow]

Deprecated

The last part of the validity check tests for a valid A or MX record for the domain part of the sender's email address. Obviously your setup is failing at that point. I presume that is something to do with your web hosting setup that checkdnserr() is not working correctly.

The best thing you could do is to just take out the A/MX record check, and your email addresses will still be tested to see if they are legally constructed, just no test to see if it's a real domain.

In Contact.php find and delete this code:
if (function_exists('checkdnsrr'))
if (!(checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A'))) return false; // domain does not have a valid A or MX record
else
if (!(win_checkdnsrr($domain, 'MX') || win_checkdnsrr($domain, 'A'))) return false; // domain does not have a valid A or MX record


That should get you in operation.

Michael Kopka

Now it works. Just a little delay in sending but it's okay ... Thanks a lot.
My SMF: AutoTrac.org [nofollow]

Deprecated

There is something a little different about your hosting service's implementation of checkdnserr(). It worked great for me and apparently for most other people, but slow for you? If I receive more reports that the checkdnserr() isn't working I can put in an option override. Most of my function that uses checkdnserr() is checking to see that there is a properly formed email address. Only that last step with checkdnserr() actually checks to see if the domain is a real valid domain. It's not absolutely essential so if it's a bother we can just turn it off and the checking will be almost as good.

edi67

I have this error
Parse error: syntax error, unexpected ')', expecting '(' in /membri/ediboard/Sources/Contact.php on line 158

Line 158 is:
      foreach (new RegexIterator($it, '~^' . $host . '~', RegexIterator::GET_MATCH) as $result)

i have smf 2.0 beta 3.1
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Deprecated

I suspect that you are running PHP 4.x on your server. I was only able to reproduce your problem by downgrading my PHP 5.2.6 to PHP 4.

I've gone ahead and rewritten that routine for both PHP 4 and 5, and posted Advanced Contact Form version 1.02 at the mod site.

I've also added a new option, "Skip sender email address domain record check." Default is that domain must have valid A or MX record. The option skips this test.

Note also that the default configuration is that the sender's email address is used as the "from" email address in the contact form email. If the sender's email address is not valid this can cause the message to error unable to send. If that happens you should set "Don't use contact form email address as sender email address" and then your contact forms will always come from your website email address.

Please let me know if this fixes your problem.

edi67

Quote from: Deprecated on October 04, 2008, 12:49:19 PM
I suspect that you are running PHP 4.x on your server. I was only able to reproduce your problem by downgrading my PHP 5.2.6 to PHP 4.

I've gone ahead and rewritten that routine for both PHP 4 and 5, and posted Advanced Contact Form version 1.02 at the mod site.

I've also added a new option, "Skip sender email address domain record check." Default is that domain must have valid A or MX record. The option skips this test.

Note also that the default configuration is that the sender's email address is used as the "from" email address in the contact form email. If the sender's email address is not valid this can cause the message to error unable to send. If that happens you should set "Don't use contact form email address as sender email address" and then your contact forms will always come from your website email address.

Please let me know if this fixes your problem.

Work perfect now with these 3 option enabled:
   Require email address:
   Don't use contact form email address as sender email address:
   Skip sender email address domain record check:


thx bro
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Burke ♞ Knight

In the configuration settings, you have the text at the right to be font color #444444

However, that makes it hard to see in dark themes.
May I make a suggestion, that in the next update, to have the text just use the default color?

Deprecated

That *is* the default color for the rest of the text on that page, at least in the default theme. My text was not in a HTML container that had CSS applied, so the text was getting browser default #000000 black which looked ugly compared to the other text on the page, so I tracked down what color was applied and found the #444444, and that's what I used. It's the only thing that would look right in the default theme.

Reverend Jeremiah

Oh darn, I would love to put this mod on my site but it is only compatable with other versions. I have 1.1.7 and I dont want to go 2.0 Beta yet because of the amount of mods I have installed would be a nightmare for me to upgrade to it.

L'AltroWeb

Hi!
I have installed your mod, all works perfectly except one warning in validation (w3c)
Contact Form Validation! :)
How i can fix?
Edit:
I've changed this line (Contact.template.php) echo 'type="text" size="24" name="name" id="name2"';
to this echo 'type="text" size="24" name="name" id="name"';
And now validation is ok!
In your opinion is a right fix???

vulcan59

I am aware that Deprecated  will not be here at SMF anymore but I would still like to register my appreciation for this mod as well as for his numerous contributions to so many here. I downloaded and install this mod with no problems. Thank you.

Best wishes in your future endeavours.

Regards.

vulcan59

Hi Michael211,

Just in case you are not aware, Deprecated has left SMF.

You can read about it in this topic Goodbye

I hope someone helps you out. You might have to do a manual uninstall. I had the same problem previously and I had to go through each file and delete the non applicable code. I came to realise that quite often the install or an uninstall does not completely do the job properly. Manual editing is very often required.

Cheers.

Advertisement: