wxcoastalforecast.php and chromebooks

I have two problems being reported that my http://www.bwsrh.com/wxcoastalforecast.php
coastal forecast page is not showing the NOAA txt file within an iFrame. The problem only appears to show in
chromebooks. I tested in other phone and tablet android devices and it seems to be OK.

Has anyone else seen this problem…can u look at my source code and see if anything stands out as
being a problem…

Thanks

Steve

It could be due to using ftp:// in the iframe instead of http://

http://tgftp.nws.noaa.gov/data/forecasts/marine/coastal/an/anz531.txt

works and Chrome is probably preventing the iframe from using a different protocol.

Thanks Ken…I tried your revised http:// link but situation is worse…now the error message from Win 10 in both Edge and Chrome is that the http:// link will not work within an iFrame…seems to be an issue related to security.

Any other ideas or maybe I need to revise the page and the way I present the txt file…

Appreciate the help

Steve

Yep, they’ve included headers in the response that prevents an iframe from displaying it

Date: Thu, 22 Jun 2017 17:46:08 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Last-Modified: Thu, 22 Jun 2017 17:33:32 GMT
Etag: “5c94944-4f7-5528fe233b19e”
Accept-Ranges: bytes
Content-Length: 1271
Vary: Accept-Encoding
Keep-Alive: timeout=300, max=99
Connection: Keep-Alive
Content-Type: text/plain; charset=UTF-8

Likely, what you’ll need to do is replace the with something like

<pre>
<?php
   $STRopts = array(
	  'http'=>array(
	  'method'=>"GET",
	  'protocol_version' => 1.1,
	  'header'=>"Cache-Control: no-cache, must-revalidate\r\n" .
				"Cache-control: max-age=0\r\n" .
				"Connection: close\r\n" .
				"User-agent: Mozilla/5.0 (wxcoastalforecast.php - www.bwsrh.com)\r\n" .
				"Accept: text/html,text/plain\r\n"
	  ),
	  'https'=>array(
	  'method'=>"GET",
	  'protocol_version' => 1.1,
	  'header'=>"Cache-Control: no-cache, must-revalidate\r\n" .
				"Cache-control: max-age=0\r\n" .
				"Connection: close\r\n" .
				"User-agent: Mozilla/5.0 (wxcoastalforecast.php - www.bwsrh.com)\r\n" .
				"Accept: text/html,text/plain\r\n"
	  )
	);
	
   $STRcontext = stream_context_create($STRopts);

   readfile("http://tgftp.nws.noaa.gov/data/forecasts/marine/coastal/an/anz531.txt",false,$STRcontext);
?></pre>

Yes, it’s a bit messy, but it will solve the fetch/display issue I think…

Thank u very much Ken…it’s now working in the chromebooks.

Steve