deformed-offering

Weather station scripts

They're free, but use at your own risk

The scripts referenced here are used in the operation of this weather station, and may be freely copied and used to support your station. Please note that you use these scripts at your own risk. No warranty is expressed or implied. I accept no liability for any damages that may ensue from their use.
You will need to configure them for your own particular weather station website.
RSS feed for Scripts Updates A RSS Feed is available to help keep you informed on updates to the scripts.

Many of these scripts are now available on GitHub at https://github.com/ktrue

Buy Me A Coffee If you find one or more of the scripts useful to you, please consider making a donation to help offset the routine expenses of operation of this website.
Thanks for your kind support!

A Version History is available -- check back from time to time to see if there are updates to scripts you have downloaded earlier. Announcements of version updates and new scripts are made on WXForum.net and Weather-Watch forums and saratogaWXPHP Twitter account as they become available.

Note: Twitter widget has been disabled 3-Jul-2023 since it no longer displays the recent update Tweets.

This page was updated 10-Feb-2022 7:53 AM

Contact Page with Login Pad

Having a 'safe' way to contact you on your website is a good idea. In 2008, Mike Challis of 642weather.com released a contact page for both standalone and Saratoga templates that used a built-in PHP script to create a captcha that minimized the ability of spambots to post messages. The bad news is that the spambots have caught on to the algorithm/structure of that captcha and so now can freely post spam using the old form/captcha that was released.

The spammer's technology has improved and so Google reCaptcha and hCaptcha challenges can now be solved by automation and the spam flood gates seem to have reopened. This script now uses a resistant-to-automatic-solution called Login Pad. It was written by Pierre Fauque to create a shuffled keypad that requires click/touch to enter a numeric code. Since click/touch is required, bots have a hard time with trying to solve this puzzle. As a bonus, there's no external service used, so no API key is needed.

This script retools Mike's original form to use the Login Pad class which is very much more resistant to spambot postings. The scripts come as a standalone contactLP.php/contactLP-inc.php which are English only. The Saratoga template wxcontact.php/contactLP-inc.php/wxcontact-LL.html offers multilingual use in the template for all supported languages.

Screen captures of standalone and Saratoga template use

Standalone Saratoga Template
Standalone Contact Form Template Contact form

Settings

Configure contactLP-inc.php with the settings for your website.


############################################################################
# begin settings
############################################################################
# always configure these options before use
# always test your contact form after making changes
#
 
$kpChallenge '26304915'// pick 8 digits, no repeats for the challenge

# optional file to contain the kpChallenge
 
$kpChallengeFile './contactlp-key.txt'
 
# Optional log file.  use '' as the name if a log file is not desired.
 
$logFile './contact-loglp.txt'// optional text log of messages.  use '' to disable.

 # email address to receive messages from this form
 
$mailto 'somebody@somesite.com';

 
# Site Name / Title
 
$sitename 'My Sitename';
 
 
# enable debug display for testing only, should be off (=false;) for production
 
$showDebug false// =false; suppress debug message, =true; enable debug messages

############################################################################
# end settings
############################################################################ 
?>
$kpChallenge
This variable specifies your numeric challenge code. It should be 8 digits long, with no repeat digits.
$kpChallengeFile
This variable specifies your OPTIONAL file to read the 8 digit $kpChallenge key from. This allows you to change the $kpChallenge key without updating the script.
$logFile
This variable controls the optional text logfile of messages sent by the script. The default is './cache/contact-log.txt'.
$logFile = ''; will disable creation of a log file.
$mailto
This is the full email address to receive the messages sent via the script
$sitename
This is a short name for your website. Email messages will arrive to $mailto address with a Subject line of:
""$sitename contact: $subject" (where $subject is from the submitted message form).

Saratoga template multilingual configuration

There are two areas to configure for multilingual configuration. The language-LL.txt and wxcontact-LL.html files are the two files to configure for each LL language on your site.

The following entries should be made to language-LL.txt:

Right-click in the above textbox, Select ALL, right-click, Copy then paste to the end of language-LL.txt and change the third field (delimited by | ) with the language translation. Make sure the translation is done using the ISO-8859-n character set appropriate to your translation, and not UTF-8. Save and upload to your website.

Copy wxcontact-en.html to wxcontact-LL.html to make a new boilerplate file for language LL. In the new file, the parts to edit are below the $main_top_text, $welcome_intro and $thank_you variables. You can use a mix of text, HTML and PHP if you like.
If you need to use literal dollar signs ( $ ), escape them by using ( \$ ), otherwise you'll have a PHP error.
Make sure the translation is done using the ISO-8859-n character set appropriate to your translation, and not UTF-8.
Also be careful to not disturb the end markers for each section.
Translate the text as desired for each section, save and upload to your site.
Note: If wxcontact-LL.html is not available on your site for language LL, then the wxcontact-en.html will be used, and if it is missing, the text in the gen_boilerplate() function in contact-inc.php will be used.

Downloads

ContactLP Form [V4.03 - 17-Jan-2022] :
Download for Standalone/Saratoga Template

Version history

  • Version 4.03 - 17-Jan-2022 fixes for better email address validation
  • Version 4.02 - 13-Jan-2022 fixes for Notice errata and adjust CSS for better LoginPad display
  • Version 4.01 - 01-Mar-2021 conditional define for not_null() function/fix whos-online script fatal error
  • Version 4.00 - 24-Feb-2021 cloned reCaptcha package to use Login Pad script instead - initial release
  • Version 3.00 - 14-Apr-2020 added scripts to allow use of hCaptcha instead of Google reCaptcha
  • Version 2.01 - 09-Aug-2018 removed each() for PHP7 compatibility
  • Version 2.00 - 07-Apr-2018 rewritten to use Google reCaptcha V2.0
  • Version 1.04 - 07-Jun-2008 added setting for captch library [path]/[folder]
  • Version 1.03 - 07-Jun-2008 added config setting for printing $thank_you message after form is sent
  • Version 1.02 - 30-May-2008 added Lat/Lon fields, fixed "TRIM here" comment syntax
  • Version 1.01 - 29-May-2008 fixed session_start warning "headers already sent"
  • Version 1.00 - 28-May-2008 PHP script originally by Mike Challis, www.642weather.com/weather

 

deformed-offering