tide table that works in php 8.0 and 8.1

have been testing tides on local synology unit with php 8.0 but only partly loads http://ballaugh.no-ip.biz:59202/WD-AJAX/wxtider.php should look like Ballaugh Weather - Ramsey Tide which is running 7.4
so is there an alternative table that will work on php 8.0 and 8.1 that uses the tideprediction.html produced by WD

i have got this working with some help from Ken on other scripts i had similar problems with Thanks Ken
i worked out the following

if using the tide_sun_moon_table_template.php


<td width="25%"><div align="left"><font size="1" face="Arial, Helvetica, sans-serif">
        <?php tides(0); ?>
        

         <em><?php sunmoon(0,nodate); ?></em>
    </font></div></td>

change to this


<td width="25%"><div align="left"><font size="1" face="Arial, Helvetica, sans-serif">
        <?php tides(0); ?>
        

         <em><?php sunmoon('0,nodate'); ?></em>
    </font></div></td>

and this will need to be done for the others ie 1 to 23 in the script
the forum is printing the character code and should look like the attached


Hi there
I have been trying to get this tide table to work for ages now, still no luck.
I even have a tides.txt file that im trying and still it wont find it.
So I will have to give you code a try and see if that works…

Thanks
Steve

Hi
i am using the script from Weather Tech - Tides Processor PHP Script although still downloadable it has not been updated since 2011 it uses the tideprediction.html created by WD

I use this as well and it runs fine on my site using PHP 8, although I do not use WD to run the actual tides program - I run it outside of WD in order to created a 12 month long file for tides. As a seaside location I often used to get requests for tides months in advance from schools wanting to make arrangements for school visits some months in advance so my site allows users to select a date up to 12 months in advance to display tide times. It has all worked pretty flawlessly for some years now.

Stuart

Hi all
Thats what im trying to get working.
Stuart sent me the files, and i am using them but all i keep getting is the screen shot.
Cant quite work out why its not finding the correct file, but will keep trying until it works… #-o


My guess is that the output file is not being uploaded to where you think it is.

Stuart

the paths are incorrect try the following
in the processor file
…/Dash/tideprediction.html
…/Dash/tides/icons

in the tide_table_template file
…/Dash/tides/tide_processor.php

The way the version of the script I have works is that it uses the webroot and you set the location of the input file relative to webroot, that way it should always find the files. That message shown is from the tides processing script to that part works. I’m not sure if the original code accesses the webroot variable which only works reliably for Apache which 99% of ISPs use.

Stuart

Hi Hcorrin

Still nothing…
The paths that i tried

in the processor file
…/Dash/tideprediction.html
…/Dash/tides/icons

in the tide_table_template file
…/Dash/tides/tide_processor.php

these produced errors saying error on line 16.
so change the files to the following code:-
TIDE Processor.php
// Set the server path to your tideprediction.html file //
$tidefile = “…/Dash/Tideprediction.txt”; //
// //
// Set the URL to the moon icons - no trailing slash //
$moonimg = “…/Dash/tides/icons”;

Tide_table_template.php

<?php // Change this to point to the tides_processor.php file require_once("tides_processor.php"); ?>

this doesnt produce any errors, but still gives the same screen shot as before?

thanks
Steve

I suspect that your root may be included the Dash part as the require_once works. Just try tides/Tideprediction.txt and the icons as tides/icons wiout the …/Dash/

Stuart

assuming the Dash is your root folder
note Tideprediction.txt will not work as the file is a lower case html file
i do know your tideprediction.html is in your Dash folder
try
in the processor file
…/tideprediction.html if that fails try ./tideprediction.html or /tideprediction.html or tideprediction.html may even work but the first one should be the one try this one first before the icons
…/tides/icons or same process as above you may even get away with ./icons for this one

leave the other file quite

Hi
Thanks will try these options and report back

Hi again
so changed the settings and got the following

with
…/tideprediction.html all i get is a blank tide table, with anything else it just the same error message.
according to the newton website if its a blank table then it cant read the file, or you have to increase the days, so will try that later or at the weekend and see what happens.
Thanks for all help.

I suspect to get to the bottom of this we need to know some things.

  1. What is the webroot of your website, you could determine this by inserting a line of code to the tides_processor1.php script just after line 11 which I sent you

echo "$WEBROOT \n ";

and then run this script on your server, this will show the fully qualified or absolute path to the start of your website on the server.

  1. what actual folders are all the files uploaded to on the server for tide data and icons

  2. the actual file names of those files.

The reason for these questions are that the files can be accessed by PHP either by their fully qualified path or can be accessed relative to the root folder. Once we have this information we can work out exactly how to define the access in the PHP script.

Stuart