Author Topic: Old advforecast2.php Error - FIXED  (Read 425 times)

0 Members and 1 Guest are viewing this topic.

Offline ed_heaton

  • Contributor
  • ***
  • Posts: 147
    • Atglen Borough Weather Observatory
Old advforecast2.php Error - FIXED
« on: September 30, 2020, 06:13:57 AM »
I just started getting this error using the old advforecast2.php. The new version is very slow to load and the old one has been working super fast and smooth until today. Any thoughts?

Warning: strpos(): Offset not contained in string in /home4/elheaton/public_html/advforecast2.php on line 707

I did switch to the new version which is working! 
« Last Edit: September 30, 2020, 07:10:39 AM by ed_heaton »

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 949
    • LexMAWeather
Re: Old advforecast2.php Error - FIXED
« Reply #1 on: September 30, 2020, 10:43:37 AM »
This is in the HTML scrape code and something isn't in the format inspected.  Middle line is 707.

Code: [Select]
  $startgrab = strpos($html, '<td colspan="2" valign="top" align="left"');
  $start = strpos($html, '<td colspan="2" valign="top" align="left"',$startgrab+1); // need second one
  $finish = strpos($html, '<hr><br>',$start);

Would need to see the HTML it is trying to parse.
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline ed_heaton

  • Contributor
  • ***
  • Posts: 147
    • Atglen Borough Weather Observatory
Re: Old advforecast2.php Error - FIXED
« Reply #2 on: October 01, 2020, 06:35:22 AM »
Thanks Jasiu for your help...  it has fixed itself which makes me happy :-)