Page 3 of 3
Re: Web tags in PHP
Posted: Sun 01 Jan 2012 11:35 am
by gemini06720
Duke, you are doing quite well - you are learning at a good paste...
Stephen, Duke is using the 'WU-forecast.php' template to produce the 'WeatherUnderground 7-Day Weather Forecast' - that template is part of the 'AJAX-PHP Saratoga templates for VWS, Cumulus, WeatherLink, WD' package.
Duke, are you working with multiple templates (such as 'top', 'header', 'footer', etc.) to produce the pages? If you do not, you should seriously should think about it...
As explained previously, to create a page, such as, for example, the '7dayforecast.php', you would start with a 'clean' template named '7dayforecast.php'; at the top of the '7dayforecast.php' template, you would use 'require' to include the 'top.php' template, then, another 'require' to include the 'header' template, then an 'include' to include the 'WU-forecast.php' script, and finally, another 'require' to include the 'footer' template.
You only need one 'top.php' template, one 'header.php' template and one 'footer.php' template - all three templates will be used for each pages.
Duke, do not forget to check your private mail folder...

Re: Web tags in PHP
Posted: Sun 01 Jan 2012 11:49 am
by serowe
gemini06720 wrote:Stephen, Duke is using the 'WU-forecast.php' template to produce the 'WeatherUnderground 7-Day Weather Forecast' - that template is part of the 'AJAX-PHP Saratoga templates for VWS, Cumulus, WeatherLink, WD' package.
Credit should still be given for the forecats though

Re: Web tags in PHP
Posted: Sun 01 Jan 2012 1:07 pm
by gemini06720
Stephen, I must be seeing something that you are not (or you are seeing something that I am not) ... the header produced by the 'WU-forecast.php' template (script) displays that it is 'WeatherUnderground 7-Day Weather Forecast:...' and at the footer displays 'Forecast from WeatherUnderground for...' with a link to the Weather Underground page for the station - so, which credit(s) should be given to what/whom?

Re: Web tags in PHP
Posted: Sun 01 Jan 2012 8:39 pm
by serowe
The second link, when I first viewed the page, had nothing to show where the forecasts were oming from. Yes I note now (revisiting the page) it does.
Going slightly off topic here though - I question the use of non-official forecasts that are becoming prolofic - I can' speak for the UK or US, but here in Oz we have the Weather Channel which a number of TV station like to use (maybe they have shares in it??? Who knows...) The problem here is that many of these 'non-official' sites use data from their countries Met Bureeau's (whatever they are called) and simply rehash the data and call it their own - quite often at odds with the official version (and just as often wrong as well).
In the case of WU personally I wouldn;t touch it with a barge pole - for the simple reason I have seen what it does to the data I upload. Example -- for whatever reason I have lost my data file for April 2009. I still have the web page FreeWx generated for that period (and, sorry to say, this is one area that FreeWx has over ALL other weatyher software packages in that it retained old display pages) so I can compare daily highs/lows/rain etc. If I DL the data for this month from QU and then compare it to this generated page here, conversion routines put in place by WU mean I have siginificantly differing rain and pressure readings and temperatures that can be as much as 3 degrees out on max/mins (both higher AND lower). This can't even be accouinted for by suggesting QU has a midnight rollover whilst I use 9am - rainfall over 3 or more days, for example, should be the same when totalled up - but WU seems, somehow, to invent rain when there is none.
So - use WU at your own risk. Check if you want, but I have seen this issue now for 10 years and only continue to contribute because of the longevity of the data retention.
Re: Web tags in PHP
Posted: Mon 02 Jan 2012 11:03 am
by duke
Ok, firstly, I just want to say thanks to you all for helping me with this. Webtags was the original subject but now we are into web page design, etc (title changed to help others

). Although I am a frequent visitor here
http://www.w3schools.com/ there is no replacement for seeing a posted sample here to gain knowledge.
1/I've had to abandon my original template as when it was enalarged by the vierer it went all out of shape

. After a quick search I believe this is something to do with "fluid style templates". I have now moved onto a fixed style.
2/ I have now cleared up these
- the '<!DOCTYPE...' should appear only once in a page, at the top of the page (you have 3 of them);
- the '<html...' should also appear only once in a page, at the top of the page, below the '<!DOCTYPE...' (you have 2 of them);
- the '</html>' should also appear only once in a page, at the bottom of the page (you have 2 of them);
3/ And the same with the weather script. After reading Ken's notes (thank you for script) I note I was "include" the wrong part. (I'm not sure why you did not see the credits but they were there when I viewed and I have now also added my own credit

).
Ray, PM sent.
Duke
Re: Web tags in PHP & other PHP items.
Posted: Sat 14 Jan 2012 12:27 pm
by duke
Carrying on from the webtags theme....Various web tags in Cumulus return a "0" or "1". How do you turn this into an output of saying (example) yes or no / online or offline. I'm assuming there is a simple script in use here but that is something I have no knowledge of....yet

.
Duke
Re: Web tags in PHP & other PHP items.
Posted: Sat 14 Jan 2012 1:04 pm
by beteljuice
if($condition) == 0 {
do something;
}else{
do the other;
}
Re: Web tags in PHP & other PHP items.
Posted: Tue 21 Feb 2012 10:46 am
by duke
I wanted to add a page to my site for testing PHP so I simply put:
But it plays havoc with the back ground and some text at the bottom is corrupt

.
Page here: REMOVED
Simply, why?
Duke
Re: Web tags in PHP & other PHP items.
Posted: Tue 21 Feb 2012 10:56 am
by serowe
Not sure what you are trying to do but the phpinfo() function call is usually made in a file with absolutely noting else in it - no background, no formatting, colours etc. Also - do NOT leave this file on your site as it can be used/run by anyone - it can contain informaiton you do not usually want others to see (paths, variables, versions etc)
Re: Web tags in PHP & other PHP items.
Posted: Tue 21 Feb 2012 11:04 am
by duke
serowe wrote:Not sure what you are trying to do but the phpinfo() function call is usually made in a file with absolutely noting else in it - no background, no formatting, colours etc. Also - do NOT leave this file on your site as it can be used/run by anyone - it can contain informaiton you do not usually want others to see (paths, variables, versions etc)
Deleted, got a bit lost for a minute there with what i was trying to do

.
Sure I'll wake up some time soon

.
Duke
Re: Web tags in PHP & other PHP items.
Posted: Tue 10 Apr 2012 8:49 pm
by duke
I want to convert my XHTML pages to HTML5 to take advantage of the new features. The main failure at W3C is the PHP webtag. How do I alter my webtag to be accepted in HTML5.
Here is an example of a current tag:
<?php echo $wchill; ?>
And here is the failure:
Error Line 34, Column 4: Saw <?. Probable cause: Attempt to use an XML processing instruction in HTML. (XML processing instructions are not supported in HTML.)
<?php
Duke
Re: Web tags in PHP & other PHP items.
Posted: Tue 10 Apr 2012 8:53 pm
by steve
Are you trying to validate the page before it's been processed by the server? PHP would normally never be seen in a web page, it gets processed by the server to generate HTML. It's the generated HTML that you should be trying to validate.
Re: Web tags in PHP & other PHP items.
Posted: Wed 11 Apr 2012 6:46 pm
by duke
Steve,
I think you are correct. I was using the checking function built into Webuilder which connects to W3C and it failed miserably. But, after uploading to the server and rechecking all PHP passed

.
Just a few minor things to sort now.
Thanks
Duke