Which code is the best to analyse information from an <form/input> : PHP or JavaScript ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Which code is the best to analyse information from an <form/input> : PHP or JavaScript ?

After creating a <form> in my HTML page, which code is the best to make information traitement (like math operations, ... ) with results from the <input> PHP or JavaScript ? Thank you for your answer. Cheers

7th Dec 2016, 10:34 PM
Pierre Dosmas
Pierre Dosmas - avatar
4 Answers
+ 2
Thank you for your answer, I have the same idea but I wanted to be sure and ask confirmation.
7th Dec 2016, 10:48 PM
Pierre Dosmas
Pierre Dosmas - avatar
+ 1
The aim of JavaScript is to make for dynamic web pages THAT'S ALL. If your not adding behaviour don't use JavaScript. JavaScript controls html and CSS. What then controls JavaScript. PHP. Which then relates them to the database which stores the data produced.
7th Dec 2016, 10:45 PM
JENN
JENN - avatar
+ 1
Maybe the main difference. The Javascript perforned the operations with such data imedietly in browser in clients computer, and display the results too, imediatly in webpage. It is very quick (when the computing is not heavy). But the Javascript has many limits (with files, databases, etc) But to PHP, the data are sending over internet to server, there the PHP modul performed them and the whole web page with results sends back to the client computer. So there is a time delay. But, the server is usually a high-performance computer, so the heavy computes run quicker here.And has access into data stores, databases, generation of pictures, password management and many more So, the asnwer is the simple compute (or checking) make in Javascript, the difficulty in PHP. Many webpages use both. But there is a one next point of view. Javascript is implemented in all browser, so you can use it (and code in) imedietly for everywhere , But for PHP you have to have a support in web server (as the PHP module). If you want to try it for learning lcally, you would install the web server with PHP module here /like XAMPP)..
8th Dec 2016, 12:31 AM
Petr Hatina
Petr Hatina - avatar
0
Hi. Me used PHP for form in my projects, but me want begin to use JavaScript.
2nd Jan 2017, 6:17 PM
Vladimir Pavlychev
Vladimir Pavlychev - avatar