dafuser
Weather Guru

OfflineLocation: Granbury, Texas Station Type: Oregon Scientific WMR100
Posts: 500 Local Time: Tuesday 16:16
|
 |
« Reply #45 on: August 15, 2008, 06:34:13 PM » |
|
I wanted to see the error to ensure I wasn't getting the same thing. I saw the error your getting and I do not get that with my contact form v1.08. Did you actually receive the test message I sent?
I see you have your contact form external from your regular site. If you need help getting it integrated let me know...
Thanks, I already added it to the templates and call it from the "Contact Us" link in the footer. I was just using the plain contact.php for esting. Everythings workng fine. Great script.
|
|
|
|
|
Logged
|
-- Thanks Les... Microsoft Windows: Proof that P.T. Barnum was correct.
24 inch iMac 2.8GHz C2D, 4 GB Ram (OS X 10.6.2 Snow Leopard) WMR100, Keyspan USB to Serial Adapter
|
|
|
mth
Rain Maker
 
OfflineLocation: Baltimore, Maryland Station Type: Davis Vantage Pro 2 - Model 6153
Posts: 1,062 Local Time: Tuesday 09:16
|
 |
« Reply #46 on: August 15, 2008, 09:10:58 PM » |
|
Mike, I keep getting an "input forbidden" message when I try to test the script. I've got this running here: http://69.143.90.55/webfiles/wxcontact2.phpMichael
|
|
|
|
« Last Edit: August 15, 2008, 09:27:01 PM by mth »
|
Logged
|
|
|
|
MCHALLIS
Rain Maker
 
OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 1,967 Local Time: Tuesday 06:16
|
 |
« Reply #47 on: August 15, 2008, 09:22:05 PM » |
|
Probably because of your host domain does not match. You can set it correctly or disable that with a setting // Site Domain without the http://www like this: $domain = 'carmosaic.com'; $domain = 'yoursite.com'; // Make sure the form was posted from your host name only. // SET $domain_protect =1; for ON, $domain_protect = 0; for OFF. // this is a security feature to prevent spammers from posting from files hosted on other domain names // "Input Forbidden" message will result if host does not match $domain_protect = 1;
|
|
|
|
|
Logged
|
|
|
|
mth
Rain Maker
 
OfflineLocation: Baltimore, Maryland Station Type: Davis Vantage Pro 2 - Model 6153
Posts: 1,062 Local Time: Tuesday 09:16
|
 |
« Reply #48 on: August 15, 2008, 09:26:43 PM » |
|
Mike, I changed the "$domain_protect" to 0 and now I am getting a PHP error when i fill in the form and click send: Fatal error: Call to undefined function getmxrr() in C:\wdisplay\webfiles\wxcontact2.php on line 648 I'm a little embarrased as it seems everyone else is not having issues.  Michael
|
|
|
|
« Last Edit: August 15, 2008, 09:28:19 PM by mth »
|
Logged
|
|
|
|
MCHALLIS
Rain Maker
 
OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 1,967 Local Time: Tuesday 06:16
|
 |
« Reply #49 on: August 15, 2008, 09:34:19 PM » |
|
Mike, I changed the "$domain_protect" to 0 and now I am getting a PHP error when i fill in the form and click send: Fatal error: Call to undefined function getmxrr() in C:\wdisplay\webfiles\wxcontact2.php on line 648 I'm a little embarrased as it seems everyone else is not having issues.  Michael Your php does not support the getmxrr function Try this: replace: function ctf_validate_email($email) { // Create the syntactical validation regular expression $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"; // Presume that the email is invalid $valid = 0; //check for all the non-printable codes in the standard ASCII set, //including null bytes and newlines, and exit immediately if any are found. if (preg_match("/[\\000-\\037]/",$email)) { return 0; } // Validate the syntax if (eregi($regexp, $email)) { list($username,$domaintld) = split("@",$email); // Validate the domain if (getmxrr($domaintld,$mxrecords)) { $valid = 1; } } else { $valid = 0; } return $valid; }
with this: function ctf_validate_email($email) { // Create the syntactical validation regular expression $regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$"; // Presume that the email is invalid $valid = 0; //check for all the non-printable codes in the standard ASCII set, //including null bytes and newlines, and exit immediately if any are found. if (preg_match("/[\\000-\\037]/",$email)) { return 0; } // Validate the syntax if (eregi($regexp, $email)) { list($username,$domaintld) = split("@",$email); // Validate the domain if ( function_exists("getmxrr") ) { if (getmxrr($domaintld,$mxrecords) ) { $valid = 1; } } else { $valid = 1; } } else { $valid = 0; } return $valid; }
let me know how it goes, if that makes it work, I will put that in the next release.
|
|
|
|
« Last Edit: August 15, 2008, 09:58:43 PM by MCHALLIS »
|
Logged
|
|
|
|
NorCal Dan
-= Dan =-
Weather Controller
   
OfflineLocation: Where the RV is parked - Beale AFB CA. FamCamp Station Type: WMR-100
Posts: 7,965 Local Time: Tuesday 08:16
|
 |
« Reply #50 on: August 15, 2008, 09:54:24 PM » |
|
I'm a little embarrased as it seems everyone else is not having issues.  Don't be embarrased, I had some problems here as well...ask questions and we will try to help find the problem...
|
|
|
|
|
Logged
|
|
|
|
mth
Rain Maker
 
OfflineLocation: Baltimore, Maryland Station Type: Davis Vantage Pro 2 - Model 6153
Posts: 1,062 Local Time: Tuesday 09:16
|
 |
« Reply #51 on: August 15, 2008, 11:41:10 PM » |
|
Mike,
That worked! All is testing and is working.....I appreciate the assistance. Thanks for sharing and keep the great scripts coming.
Michael
|
|
|
|
|
Logged
|
|
|
|
MCHALLIS
Rain Maker
 
OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 1,967 Local Time: Tuesday 06:16
|
 |
« Reply #52 on: August 15, 2008, 11:56:37 PM » |
|
Version: 1.10 - 14-Aug-2008 small fix in function ctf_validate_email This update is not needed unless you were getting this error on send: Fatal error: Call to undefined function getmxrr()
|
|
|
|
|
Logged
|
|
|
|
drobbins
Rain Maker
 
OfflineLocation: Kentucky, USA Station Type: Davis Vantage PRO2
Posts: 1,003 Local Time: Tuesday 06:16
|
 |
« Reply #53 on: August 16, 2008, 01:46:20 AM » |
|
I got my first "contact" today!!  Just someone saying "Hi".
|
|
|
|
|
Logged
|
|
|
|
chashock
Newbie
Offline
Posts: 2 Local Time: Tuesday 12:16
|
 |
« Reply #54 on: August 16, 2008, 05:02:37 AM » |
|
This script is great. I appreciate the work you've put into it.
The only question I've got is whether it is feasible to have the same form used for a domain that also has aliases, without turning off domain checking?
I have a domain xyz.com that I have aliased via Apache to also reply to abc.com. With the way the php is currently set up, I don't see how to allow both domains to post a message, since I can only enter a single domain into the $domain variable. Since I've used the ServerAlias Directive in Apache, and used all relative linking on the sites, when a user comes in via abc.com, there is no redirect to xyz.com, all references are from abc.com for the duration of their visit. Therefore, if I have xyz.com listed in the script, and they come in on abc.com, they get the "Input Forbidden" error.
The obvious immediate workaround is to disable $domain_protect, but I'm wondering if an array could be used here without a large re-write of code. I'm no PHP programmer, but thought this might be an easy way to alleviate the problem.
Your thoughts?
|
|
|
|
|
Logged
|
|
|
|
MCHALLIS
Rain Maker
 
OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 1,967 Local Time: Tuesday 06:16
|
 |
« Reply #55 on: August 16, 2008, 03:26:52 PM » |
|
This script is great. I appreciate the work you've put into it.
The only question I've got is whether it is feasible to have the same form used for a domain that also has aliases, without turning off domain checking?
.... Your thoughts?
Here is a solution: change your $domain config to an array with the domains you want.. // Site Domain without the http://www like this: $domain = 'carmosaic.com'; // can be a single domain: $domain = 'carmosaic.com'; // can be an array of domains: $domain = array('carmosaic.com','someothersite.com'); $domain = array('abc.com','xyz.com'); Change this part of the function ctf_spamcheckpost Change: // Host names from where the form is authorized // to be posted from: $dom = $domain; $authHosts = array("$dom");
To: // Host names from where the form is authorized // to be posted from: if (is_array($domain)) { $domain = array_map(strtolower, $domain); $authHosts = $domain; } else { $domain = strtolower($domain); $authHosts = array("$domain"); }
also change: $msg = "Sent from $sitename contact form at $domain to: $msg = "Sent from $sitename contact form I added to Version: 1.11 - 16-Aug-2008 This update is not needed unless you need this feature
|
|
|
|
« Last Edit: August 16, 2008, 05:07:35 PM by MCHALLIS »
|
Logged
|
|
|
|
MCHALLIS
Rain Maker
 
OfflineLocation: Long Beach, WA USA Station Type: Davis VP2+
Posts: 1,967 Local Time: Tuesday 06:16
|
 |
« Reply #56 on: August 16, 2008, 05:06:25 PM » |
|
Version: 1.11 - 16-Aug-2008added feature to have the same form used for a domain that also has aliases, without turning off domain checking http://www.weather-watch.com/smf/index.php/topic,33604.msg274348.html#msg274348This update is not needed unless you need this feature
|
|
|
|
|
Logged
|
|
|
|
chashock
Newbie
Offline
Posts: 2 Local Time: Tuesday 12:16
|
 |
« Reply #57 on: August 18, 2008, 06:39:36 PM » |
|
Outstanding. Thank you so much. I was missing the piece on how to check against the array. Worked like a charm!
|
|
|
|
|
Logged
|
|
|
|
reif
Junior Forecaster
  
OfflineLocation: Denver, Colorado USA Station Type: Davis Vantage Pro Wireless
Posts: 55 Local Time: Tuesday 18:16
|
 |
« Reply #58 on: August 20, 2008, 05:51:38 PM » |
|
Mike,
How would one go about adding check boxes to the script?
Thanks very much, Reif Heck
|
|
|
|
|
Logged
|
|
|
|
nyunyu
Junior Watcher
Offline
Posts: 8 Local Time: Tuesday 12:16
|
 |
« Reply #59 on: August 20, 2008, 06:24:29 PM » |
|
Hello, i was looking for a contact form script with captcha and lands on this page. However, I can't seems to download the secure cpatcha file. Anyone got working link?
|
|
|
|
|
Logged
|
|
|
|
|