PHP vs JavaScript

brucemc777

New Member
I am cramming info on webdesign, and presently studying php for need of online forms, having to maintain a server database of that info and to email formfields (CGI).

My next topic of study is presently contemplated to be JavaScript, but in my studies I started to wonder when is one used vs. the other, and if overlapping, the advantage/disadvantages of each.

Any good resources to learn from, or can anyone put it in a nutshell for me?
 

ronaldroe

Super Moderator
Staff member
Php is server-side script. JS is client side, for the most part. Very little overlap.
 

brucemc777

New Member
I can see that I would use php to process form inputs and maintaining the server side database; what does one normally specifically use JS for? I am sorry if that is a stoooopid question, but the answer will help lay the foundation for my studies-

Ohhhh, btw, many years ago I went to OCU!
 

brucemc777

New Member
So we basically have speed and efficiency of presentation with JS, and PHP gives us storage and ways to make user action permanent, if I am grasping the concepts-
 

Edge

Member
... and Javascript relies on the browser capabilities whereas PHP doesn't. Sometimes it's handy to do stuff with a form before it's sent to a server i.e. some form of validation to minimise server overheads. There used to be an accessibility issue about using JavaScript as early versions of screenreaders used by visually impaired had trouble with it. Modern screenreaders don't have issues with JavaScript now unless it's Ajaxian and is being used to pull content onto the page which wasn't there before. However you still find some companies and organisations who still think JS is an accessibility issue however it's implemented.
 
Top