Author Topic: ContactLP Form Question  (Read 792 times)

0 Members and 1 Guest are viewing this topic.

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
ContactLP Form Question
« on: January 11, 2022, 06:57:00 PM »
Ken,

I tried implementing the ContactLP Form today and was successful. However, I noticed that the "blocks" in the form do not align horizontally. It appears the blank "blocks" are aligned higher than the "blocks" containing numbers. When I look at the contact page at Saratog-Weather.org, I see the same thing with mis-aligned "blocks". However, when I look at the screenshots on the ContactLP Form page in your script section, all the blocks on a row appear to be level. Did something in the code change between the time you took the screenshots and the current iteration of the code?

Thanks,

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9278
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #1 on: January 12, 2022, 12:02:12 PM »
Very odd.. it seems to be a browser-specific issue.

On Firefox, and SeaMonkey on Windows 10, it all looks like what is shown in the script page and the GitHub distribution (4 button rows.
On Chrome, Brave, Edge, Opera on Windows 10, it has the 4-button rows, but the 'empty' buttons are jogged up a bit compared to the buttons with numbers.

On an iPad or iPhone, Safari, Chrome, Firefox all show the two button-narrow column instead of the 4 button wide pad.

Looks like I need to do some CSS tweaking to have it look the same on all browsers.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: ContactLP Form Question
« Reply #2 on: January 12, 2022, 12:22:13 PM »
Hey Ken,

Glad to know it wasn't something I did wrong, but sorry to dump more work on your always-full plate.

Thanks very much.

Steve

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9278
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #3 on: January 13, 2022, 01:19:36 PM »
Wow, that took a lot of exploring to fixup the CSS for the pad display so it looks mostly the same on all browsers.

V4.02 is now available, and the main change is to the CSS in contactLP.php/contactLP-inc.php.

Available on the script page or on GitHub distribution

I've tried it with Firefox, Google Chrome, Opera, Brave, SeaMonkey, Edge and IE11(yech!) on Windows 10, and on Safari on iPad/iPhone (iOS 15.2).  I don't have a working Mac to test with Safari on MacOS (sorry).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline SteveFitz1

  • Forecaster
  • *****
  • Posts: 521
    • Tyler Texas Weather
Re: ContactLP Form Question
« Reply #4 on: January 13, 2022, 05:32:00 PM »
Got the update installed and it looks much better. Thanks for your work.

Steve

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: ContactLP Form Question
« Reply #5 on: January 15, 2022, 09:09:28 AM »
One issue I found (not with the new update) in contactLP-inc.php, is in the function "validate_email". An email address that contains a "dash" would not validate even though it is a valid email address.  example: joe@joe-sam.com.   To get around it I just forced the $valid flag to 1 at the end of the function. I don't know enough about PHP to correctly fix the function to allow "dash".

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9278
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #6 on: January 17, 2022, 07:12:17 PM »
I've done an update to contactLP-inc.php V4.03 to better handle those type of email addresses.  It now handles emails with - or . in the name or in the hostname.

Updated on the script page and the GitHub distribution

I tried a bunch of different regex mods, and this one seemed to be the best one in testing.  Here's the results on various email addresses:

Code: [Select]
Valid email: 'm-0-o.bfe-nfk@s-ugd-og.gg-gm-ain.com.pl'

Valid email: 'wfff-ef-ff.mi-ki.fi-ki.miki@dns1-su-ddd.o-ma.in.dom-ain.tech'

Valid email: 'max-io.be-nko@sub-dom-ain.dom-ain.com.tv'

Valid email: 'webmaster@some-weather.org'

NOT VALID email: 'Jean-François+@anydomain.museum'

Valid email: 'Jean-Francois+@anydomain.museum'

Valid email: 'joe@joe-sam.com'

The original regex had these results
Code: [Select]
Valid email: 'm-0-o.bfe-nfk@s-ugd-og.gg-gm-ain.com.pl'

Valid email: 'wfff-ef-ff.mi-ki.fi-ki.miki@dns1-su-ddd.o-ma.in.dom-ain.tech'

Valid email: 'max-io.be-nko@sub-dom-ain.dom-ain.com.tv'

Valid email: 'webmaster@some-weather.org'

NOT VALID email: 'Jean-François+@anydomain.museum'

NOT VALID email: 'Jean-Francois+@anydomain.museum'

Valid email: 'joe@joe-sam.com'

« Last Edit: January 17, 2022, 07:17:32 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline mexbound

  • Senior Member
  • **
  • Posts: 66
Re: ContactLP Form Question
« Reply #7 on: January 18, 2022, 08:36:03 AM »
Thanks for the update. Works perfect!

Offline bridger

  • Member
  • *
  • Posts: 7
    • Fordingbridge Weather
Re: ContactLP Form Question
« Reply #8 on: March 21, 2024, 11:02:00 AM »
I am trying to set up the ContactLP Form on my Saratoga template but I am not receiving test messages in either of the email accounts I am using.
The messages are are being logged in the contact-loglp.txt file.
I have initially configured $showDebug = true and $doStandalone = true
I have temporarily removed the link from my webpages but it can be found here https://www.fordingbridgeweather.co.uk/saratoga/wxcontact.php
Appreciate any help.
Peter
   

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9278
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #9 on: March 21, 2024, 12:08:53 PM »
If your're seeing the message logged in the log file, that means it passed the message correctly to the PHP mail() function for sending.
I suspect that the mail() PHP function is not configured to allow sending of mail from your site -- Try the following simple test script on your website.

Quote
<?php
header("Content-type: text/plain,charset=ISO-8859-1");

error_reporting(E_ALL);
ini_set('display_errors','1');

$msg = "This is a test message from ".$_SERVER['HTTP_HOST'].".\n";
$to  = "your@email.address"; // <---- configure to your email address
$subject = "Mail function test";

$result = mail($to,$subject,$msg);

if ($result) {
   print "mail() was successful\n";
} else {
   "mail() was not successful\n";
}
$smpath = ini_get('sendmail_path');
print "Mail using '$smpath' as mailer\n";


if it doesn't successfully send mail, then contact your hoster's tech support to resolve the issue.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline bridger

  • Member
  • *
  • Posts: 7
    • Fordingbridge Weather
Re: ContactLP Form Question
« Reply #10 on: March 21, 2024, 01:31:57 PM »
Thanks for your prompt reply.
The test script works fine, so where might I be going wrong in the config?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9278
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: ContactLP Form Question
« Reply #11 on: March 21, 2024, 01:34:58 PM »
I can't tell remotely -- send your contactLP-inc.php script to webmaster @ saratoga-weather.org and I'll take a look.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline bridger

  • Member
  • *
  • Posts: 7
    • Fordingbridge Weather
Re: ContactLP Form Question
« Reply #12 on: March 21, 2024, 04:41:37 PM »
Working fine now.
Thanks