Well, I wrote WXSIM, but I don’t know much about PHP!
I’ve just now been trying to get Ken’s PHP script to produce the type of forecast output that most of my users are now doing regularly. I successfully tested to see that my server will execute PHP files, by using the little test script on Ken’s site, calling it test.php, uploading it, and opening it in a browser.
I’ve uploaded all the carterlake icons to a /forecast/images subdirectory, and uploaded both the plaintext-parser_php.htm and plaintext-parser-data.txt files to my root directory, the former with only the slight modification of changing the forecast site name. When I try to open the plaintext-parser_php.htm in IE, it just displays the contents of the script (as if I wanted to edit it), instead of “doing” anything. I wondered if the problem was the .htm ending, so I renamed it as wxsimphp.php, but with the same result. It’s at www.wxsim.com/wxsimphp.php.
I’m guessing - hoping at least - this is something simple.
look at the source when you browse to it, i think you edited the page with something,but NOT a text-editor like notepad or so
all those > and < are replaced with < and >
i think that is the problem
Thanks for the suggestions. I had edited it in Notepad, though it briefly tried to open up in Word at one point (I don’t think I had saved that). Anyway, I downloaded it again and edited with Notepad, and it still didn’t work. So, I downloaded it again and uploaded it to my site totally unaltered. I tried opening again in IE, and exactly the same thing - it just opens showing the contents of the script.
I think once a file is created as type text, it wants to stay that way, even when that file is renamed later. Try uploading a fresh copy, making sure Notepad doesn’t save it as type text.
I downloaded a copy of your file and got the same results on my server. I then looked at the code and the answer is in Pinto’s post above. Try a search and replace and change all ocurances of < to < and > with > . Those two symbols are vital for PHP to know when to stop and start.
Better yet, get another copy from here http://saratoga-weather.org/plaintext-parser.php?sce=view then just do a File-Save as and save it as a text file. Once you’ve done that, the first line should be <?php and the last line in the file should be ?> . If they’re not, we still have a problem getting a good download.
The difference seems to have been the link, as I did the same thing with both as far as I could tell. I expect I’ll be doing some fine-tuning and then linking to it from my web page. For the moment, you can see it at www.wxsim.com/wxsimatl.php.
I expect I’ll be looking at many of my customers’ web pages for idea!