Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Vote for the next article - PHP or Javascript

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Next website development article?

Poll ended at Sat 25 Jun 2011 10:57 am

PHP
11
52%
Javascript
10
48%
 
Total votes: 21

User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Vote for the next article - PHP or Javascript

Post by daj »

Folks,

Following on from my articles introducing Stylesheets and Web page layout.....

http://wiki.sandaysoft.com/a/Stylesheets
http://wiki.sandaysoft.com/a/Webpage_layout

I'm trying to decide on my next topic -- Javascript or PHP. Both are equally useful to the modern website developer!

Please take a moment to vote -- I will let it run for a week or so and then do which ever one is most popular.
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Vote for the next article - PHP or Javascript

Post by mcrossley »

David, how about adding JQuery and JSON to your ToDo list?
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Vote for the next article - PHP or Javascript

Post by daj »

TBH, the Javascript would include jQuery as it makes things much simpler than 'raw' Javascript. I could certainly write something on JSON too but not in an intro article, but maybe on its own.

I think each of these two topics (PHP and JS) spawn a few sub-topics like MySQL, JSON, AJAX techniques. I could be busy :lol:
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
mcrossley
Posts: 12685
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Vote for the next article - PHP or Javascript

Post by mcrossley »

Its funny but the other day I wondered how JQuery performed against raw JavaScript, after Googling for a while it seems it is about 500-600 times slower processing 'large' pages. So the convenience comes at a cost - as ever. Now I really must learn JQuery... :lol:
Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Vote for the next article - PHP or Javascript

Post by Graham64 »

David
I, for one, would find it very helpful if you could add to the excellent articles that you have already written for the Wiki. I have voted for PHP, however what about a brief general article on the what/why/whens of PHP and Javascript?

From reading many of the messages on the forum I can just about understand the programs listed and it seems as though they both can do similar things but I can't find out which is best to use for which purpose.

For example:
  • PHP has the advantage that it is all on the server side - so what?
    Javascript has the ability to do timings, does PHP?
Sorry if these are all very basic questions but I would like to know when to use PHP, when to use Javascript and what are the advantages/disadvantages of both.

These questions could also be applied, it seems, to other choices, for example the different graphing methods that have been quoted on the message board.

Thanks for all your work on the Wiki - very useful.

Graham
bnwrx
Posts: 464
Joined: Wed 25 Feb 2009 12:01 am
Weather Station: Ambient WS2095 (Fine/Offset)
Operating System: Windows 10 64bit
Location: Woodland Park, Colorado USA
Contact:

Re: Vote for the next article - PHP or Javascript

Post by bnwrx »

Graham64 wrote:David
I, for one, would find it very helpful if you could add to the excellent articles that you have already written for the Wiki. I have voted for PHP, however what about a brief general article on the what/why/whens of PHP and Javascript?

From reading many of the messages on the forum I can just about understand the programs listed and it seems as though they both can do similar things but I can't find out which is best to use for which purpose.

For example:
  • PHP has the advantage that it is all on the server side - so what?
    Javascript has the ability to do timings, does PHP?
Sorry if these are all very basic questions but I would like to know when to use PHP, when to use Javascript and what are the advantages/disadvantages of both.

These questions could also be applied, it seems, to other choices, for example the different graphing methods that have been quoted on the message board.

Thanks for all your work on the Wiki - very useful.

Graham
I second Graham64 ideas. David is so knowledgable on these subjects. I am still trying to understand so much :o
I now have a paid webhost that offers MySql data bases, but I have no idea how to send data to them.... :oops: !!
User avatar
daj
Posts: 2041
Joined: Tue 29 Jul 2008 8:00 pm
Weather Station: WH1081
Operating System: Pi & MX
Location: SW Scotland
Contact:

Re: Vote for the next article - PHP or Javascript

Post by daj »

Ok, here are some basics on the different technologies. Broadly speaking (before anyone starts chipping in with the , "Ah, but..." comments) !!


HTML
All web pages are written using the HTML language -- this describes the content of the page and how a page is laid out. HTML is sent from a web server and the browser then displays it.

CSS (Stylesheet)
This is used in conjunction with HTML to style your page (colour, position, etc). Again this is sent from the webserver and the browser uses it to display the page

Javascript
This is a language used by your browser to manipulate the page being displayed on screen. It is always executed on the browser (so all the work is done on the users machine -- pc/mac/phone, etc). JavaScript is supported by all modern browsers, incudling some mobile phones (iPhone, Andriod, etc). The user does have the option to turn off Javascript (some consider it a security risk) however by default it is turned on and most modern sites rely heavily on Javascript. IE has one of the worst iplementations of Javascript (mostly for speed) but is much better in IE8/9

PHP
This is loosely based on the Javascript language (for syntax). It's major difference is that it is run on the webserver BEFORE the HTML page is sent to the users browser. It never runs on the browser. PHP is typically used to add logic/intelligent to a web page. (example,you have data from a Cumulus webtag to say it is raining, so show a picture of a cloud) Whatever output PHP produces must be in HTML. So, when you request a web page from the server containing PHP the web server will execute this, build the resultant page (in HTML), and send the result to the browser. PHP must be enabled on the webserver. Most good hosting firms enable it by default. Most free hosts do not.

When to use JS (Javascript) or PHP ?

Using PHP is much faster (usually) as all the work is done on the webserver (which is fast) and the result is sent to you
Javascript is slower as all the JS code is sent to the browser, then executed on the PC, and the page updated
A user may have JS disabled, so you might need to consider that your page will not work
If you do not have PHP on your webserver you need to use JS!

To be honest, you will probably use both.

If you look at this page...http://www.grantownweather.co.uk/realtime it starts off as PHP so that I can use logic on the web server to build the page and send the results. I then use Javascript to update the page every 30 seconds and highlight changes in yellow.

What about Ajax?
Ajax is, in essence, a concept not a new language. It's basically JavaScript and it works in the background while you are viewing a page on the browser. In the above example, I am actually using Ajax methods to go back to the webserver and get data every 30 seconds; I then use Javascript to update the page layout/content

and jQuery?
This is simply a library of Javascript code (functions). Using jQuery I can use simple commands to do tasks that would take several lines of Javascript. jQuery is Javascript.

any questions? LOL Hope that helped ;)
David
kippfordweather.uk
Cumulus MX & Raspberry Pi
User avatar
nking
Posts: 808
Joined: Thu 17 Dec 2009 2:03 pm
Weather Station: W-8681
Operating System: Windows 10
Location: Hurstpierpoint, West Sussex, UK
Contact:

Re: Vote for the next article - PHP or Javascript

Post by nking »

Thanks David - CRYSTAL! :)
Graham64
Posts: 74
Joined: Mon 23 Aug 2010 5:04 pm
Weather Station: Davis Vantage Pro 2
Operating System: Windows XP
Location: Cornwall, England
Contact:

Re: Vote for the next article - PHP or Javascript

Post by Graham64 »

David
Thanks very much, that is just what I wanted - a concise summary in one place. I, for one, will find it very useful.

What about putting it on the Wiki as a good starting point that can easily be found for those of us new to a lot of the languages etc?

Graham
User avatar
JennyLeez
Posts: 314
Joined: Wed 16 Dec 2009 2:32 am
Weather Station: La Crosse WS3083
Operating System: Windows XP, Win7 & Win 10
Location: Wairoa, Hawkes Bay. New Zealand.
Contact:

Re: Vote for the next article - PHP or Javascript

Post by JennyLeez »

Thanks for the summary David.

I see php won the poll so now I wait for my php lessons :)
Wairoa, Hawkes Bay, New Zealand Weather Station:
http://wairoa.net/weather/index.htm
Cumulus Topsites:
http://cumulussites.net/
Image
duke

Re: Vote for the next article - PHP or Javascript

Post by duke »

Does the PHP article exist yet? I need to start somewhere :D

Duke
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Vote for the next article - PHP or Javascript

Post by steve »

David seems to be taking a sabbatical. Hopefully he'll be back before long.
Steve
duke

Re: Vote for the next article - PHP or Javascript

Post by duke »

In it's abscence can anyone suggest a good place to start?

Duke
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Vote for the next article - PHP or Javascript

Post by steve »

php.net is a good place for information on PHP. There's a getting started tutorial here - http://php.net/manual/en/tutorial.php
Steve
gemini06720
Posts: 1700
Joined: Mon 10 Aug 2009 10:16 pm
Weather Station: No weather station
Operating System: No operating system
Location: World...

Re: Vote for the next article - PHP or Javascript

Post by gemini06720 »

Another good Internet location would be W3Schools' PHP Tutorial...
Post Reply