I am trying to move my files from godaddy to infinityfree. I have ten years cpanel and php experience.
I’ve built a weather page with current weather data, moon phase, seven day forecast, regional and local radar. I would like php solutions but all suggestions are welcomed.
How to replace custom commands in my weather php5 script?
I am working on http://dfellows.rf.gd/site_html/weather13.php
Part of weather13.php:
$filename = 'ksgf.xml';
$searchString = 'wind_string';
if(file_exists($filename)){//if $filename exists check it for searchString.
if(exec('grep '.escapeshellarg($searchString).' '.$filename)) {
if(strlen($weather->wind_string)<=5){echo $weather->wind_string; goto end;}
if(!preg_match('/^[f]/i',$weather->wind_string)){list($a,$b)=explode('(',$weather->wind_string);echo $a;goto end;}
if(preg_match('/^[f]/i',$weather->wind_string)){list($a,$b)=explode('(',$weather->wind_string);echo substr($a,8,44);goto end;}
} else {echo "No wind data at this time";}}
I should be seeing this:
Instead I get my custom error message “No wind data at this time”
To bust caching I add the results of:
/* CACHE BUSTING HASHSTAMP IN GRAPHICS FILENAMES */
$hash2=hash_file('crc32', '../images/weather-seven-day-forecast-graphic.jpg');
to the filenames of the moonphase and seven day forecast graphics. Can I do this on free hosting? If not how can I accomplish this using php?
I’ve enabled display errors with alter php config.