Try out the various forms of reCAPTCHA.
+You can find the source code for these examples on GitHub in google/recaptcha.
+-
+
reCAPTCHA v2
+ +
+ reCAPTCHA v3
+-
+
- Request scores +
+ General
+ +
+
diff --git a/contact-form/LICENSE.md b/contact-form/LICENSE.md new file mode 100644 index 0000000..d5ca331 --- /dev/null +++ b/contact-form/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Hans Adema + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/contact-form/README.md b/contact-form/README.md new file mode 100644 index 0000000..3d8440f --- /dev/null +++ b/contact-form/README.md @@ -0,0 +1,36 @@ +# Simple Contact Form with PHPMailer + +A simple contact form with PHPMailer, reCAPTCHA and Bootstrap. + +Use this to provide a simple contact form on your own website, and send the messages with SMTP. Or use this as a basis or example to create your own contact form. + +## Getting Started + +1. Download the latest version of the contact form: https://github.com/InfinityFreeHosting/contactform/releases +2. Extract the archive on your own computer. +3. Copy the `config.example.php` to `config.php` and edit the required settings. +4. Upload the extracted files to a subdirectory of your hosting account (e.g. `htdocs/contact/`). +5. Navigate to http://your-domain.epizy.com/contact/ and try out the form! + +### How to get your SMTP credentials + +To be able to send messages with this contact form, you'll need a working SMTP service. InfinityFree does not provide this with free hosting, but you can use third party SMTP services. + +A simple, free option to use is Gmail. You can use Gmail to send your messages like so: + +1. Sign up for a free Gmail account. +2. Enable Two Factor Authentication on the Google account: https://myaccount.google.com/signinoptions/two-step-verification +3. Generate an App Specific Password for the account: https://myaccount.google.com/apppasswords +4. In the configuration file, set the SMTP Hostname `smtp.gmail.com`, enter your full Gmail address in the SMTP Username field and enter the App Specific Password in the SMTP Password field. + +### How to get your reCAPTCHA credentials + +To prevent spammers from being able to abuse your contact form, reCAPTCHA has been integrated by default. reCAPTCHA is a free service from Google which can prevent automated scripts from using your form. + +This contact form has been integrated with reCAPTCHA v2 with the Checkbox challenge. To use this, you will need to setup your site in reCAPTCHA like so: + +1. Go to the reCAPTCHA admin console: https://www.google.com/recaptcha/admin/create +2. Enter a label you can use to identify your website. +3. Choose the reCAPTCHA type "reCAPTCHA v2" and the version "Checkbox 'I'm not a robot'". +4. Under Domains, enter the domain name of your website. +5. Accept the reCAPTCHA terms and click Send. diff --git a/contact-form/config.example.php b/contact-form/config.example.php new file mode 100644 index 0000000..4e36a88 --- /dev/null +++ b/contact-form/config.example.php @@ -0,0 +1,37 @@ + + + +
+ + + + + + + +Try out the various forms of reCAPTCHA.
+You can find the source code for these examples on GitHub in google/recaptcha.
+If you do not have keys already then visit https://www.google.com/recaptcha/admin to generate them. Edit this file and set the respective keys in $siteKey and $secret. Reload the page after this.
+ +This example is sending the Content-Security-Policy header. Look at the source and inspect the network tab for this request to see what's happening. The reCAPTCHA v3 API is being called here, however you can use the same approach for the v2 API calls as well.
+NOTE:This is a sample implementation, the score returned here is not a reflection on your Google account or type of traffic. In production, refer to the distribution of scores shown in your admin interface and adjust your own threshold accordingly. Do not raise issues regarding the score you see here.
+If you do not have keys already then visit https://www.google.com/recaptcha/admin to generate them. Edit this file and set the respective keys in the config.php file or directly to $siteKey and $secret. Reload the page after this.
+ +That's it. Everything is working. Go integrate this into your real project.
+ + +Check the error code reference at https://developers.google.com/recaptcha/docs/verify#error-code-reference. +
Note: Error code missing-input-response may mean the user just didn't complete the reCAPTCHA.
+ + +Complete the reCAPTCHA then submit the form.
+ + + + +If you do not have keys already then visit https://www.google.com/recaptcha/admin to generate them. Edit this file and set the respective keys in the config.php file or directly to $siteKey and $secret. Reload the page after this.
+ +That's it. Everything is working. Go integrate this into your real project.
+ + +Check the error code reference at https://developers.google.com/recaptcha/docs/verify#error-code-reference. +
Note: Error code missing-input-response may mean the user just didn't complete the reCAPTCHA.
+ + +Complete the reCAPTCHA then submit the form.
+ + + +If you do not have keys already then visit https://www.google.com/recaptcha/admin to generate them. Edit this file and set the respective keys in $siteKey and $secret. Reload the page after this.
+ +That's it. Everything is working. Go integrate this into your real project.
+ + +Check the error code reference at https://developers.google.com/recaptcha/docs/verify#error-code-reference. +
Note: Error code missing-input-response may mean the user just didn't complete the reCAPTCHA.
+ + +Submit the form and reCAPTCHA will run automatically.
+ + + + +If you do not have keys already then visit https://www.google.com/recaptcha/admin to generate them. Edit this file and set the respective keys in $siteKey and $secret. Reload the page after this.
+ +The reCAPTCHA v3 API provides a confidence score for each request.
+NOTE:This is a sample implementation, the score returned here is not a reflection on your Google account or type of traffic. In production, refer to the distribution of scores shown in your admin interface and adjust your own threshold accordingly. Do not raise issues regarding the score you see here.
+'; + foreach ($this->errors as $e) { + print_r($e); + } + echo ''; + } + } + + /** + * Get an array of error messages, if any. + * + * @return array + */ + public function getErrors() + { + return $this->errors; + } + + /** + * POP3 connection error handler. + * + * @param int $errno + * @param string $errstr + * @param string $errfile + * @param int $errline + */ + protected function catchWarning($errno, $errstr, $errfile, $errline) + { + $this->setError( + 'Connecting to the POP3 server raised a PHP warning:' . + "errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline" + ); + } +} diff --git a/contact-form/vendor/phpmailer/phpmailer/src/SMTP.php b/contact-form/vendor/phpmailer/phpmailer/src/SMTP.php new file mode 100644 index 0000000..c693f4d --- /dev/null +++ b/contact-form/vendor/phpmailer/phpmailer/src/SMTP.php @@ -0,0 +1,1370 @@ + + * @author Jim Jagielski (jimjag)
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
@@ -115,7 +124,7 @@
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus commodo
@@ -171,50 +180,37 @@
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
- tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus
- commodo viverra maecenas accumsan lacus vel facilisis. My Tools For Creating Awesomeness
So. Let's have a chat
+ So. Let's talk
+