So the tideprediction.html is in the same directory as tides_processor.php ?
If that’s so try:
$tidefile = “./tideprediction.html”;
Yes…that is correct,
I will try that again, maybe this time it will work
Made the suggested change, now I get empty cells instead of the red font warning that the tide data is being updated.
Try changing
error_reporting(0);
to
error_reporting(E_ALL);
in tides_processor.php
Then hopefully we should see some errors when running http://www.southturnermaineweather.com/tides_processor.php
Changed the error reporting and now it comes back with multiple errors in the tide table
Could you possibly post your ‘tides_processor.php’ script here - just rename the script as ‘tides_processor.php.txt’ so it can be attached to your reply.
You have obviously place the (Niko) recommended ‘error_reporting(E_ALL);’ at the wrong place as the script displays nothing and seems to have no source. :?
Curiously it does show errors when called from http://www.southturnermaineweather.com/wxtides.php, but I agree, let’s see the script
here is the script
tides_processor.php.txt (15.1 KB)
Assuming this line 39 refers to the dates in tideprediction.html I think you need to change $yearDate to “no”, or whatever it was originally, since your dates do not have the year:
// If your tide dates include years (Monday 2008-09-10) change this to "yes" //
$yearDate = "yes"; //
Wednesday 01-10
Sunrise 0713, Sunset 1623
Moonrise 0113, Moonset 1221
High Tide: 0559 9.3
Low Tide: 1217 0.6
High Tide: 1829 8.5
got part of the tides back now still showing issues with sun and moon
Try changing line 43 to “yes”
$convertRF = "no";
Matthew, I am working on the script you have posted a few days ago.
There are many variables that have not been ‘declared’ (such as, for example, setting the default value of the variable $moon to null). So, when an ‘if’ statement only check if the variable within (the ‘if’ statement) is ‘yes’ and does not provide an option in case the variable within (the ‘if’ statement) is ‘no’, then errors are produced and they prevent the script from continuing and producing the expected results…
Hi all,
I’ve just started using the script and am having problems, I get the the empty table but nothing else. I’m not expert at all with php and need a bit of help please.
This is the table link http://www.sunwharf.com/willingdon/tides/tides.html
the input data is here http://www.sunwharf.com/willingdon/tideprediction.html
The tides_processor is in directory Index of /willingdon/tides and the icons directory is a sub-directory from there
I’ve attached the tides.html and tides_processor files as text files.
Any clues to what I’ve done wrong?
Thanks
Nick
tides.html.txt (3.43 KB)
tides_processor.php.txt (15.1 KB)
See attachment…note the unzip directions…
Thanks for that but I’m a bit confused. That’s just a jpg of the the download link and I’ve already downloaded the zip file and believe I installed in line with the instructions. I can generate the tide table data but just can’t get it to populate into tabular form.
Cheers
Nick
Nick I think the issue is that the php code is not being executed on the server, it should not show up when viewing the page source the php code should be executed on the server and just the result show up in the page source on the browser. Make sure you have PHP active on your server. Then try renaming your file to tides.phtml which if the server is set up correctly should tell it that the file contains php code which must be executed on the server side before being sent to the browser.
Stuart
That’s great, just renamed file to phtml and the table is populated https://www.sunwharf.com/willingdon/tides/tides.phtml
Thanks very much Stuart, most kind of you. I have never seen phtml as a file extension before.
Thanks again
Nick
You have to tell the server the file contains PHP code to be executed and that is one way, the other is a .php extension but in your case that would not work. You can also force the server to check a .html file for PHP code but that wastes time if there is none there.
Stuart