I want to be able to display some metrics on my webpage, for example "How many users I have"
How am I able to do this? Is it better with php or javascript?
PHPJavaScript
Last Comment
Ray Paseur
8/22/2022 - Mon
Peos John
Do you want to display this metrics from the database? or Is it static information that you want to show it on the page?
Javascript is Client side scripting language where the code runs on browser and used for performing actions on the browser.
Jazzy 1012
ASKER
I want to show metrics from my database
Ray Paseur
I think the PHP approach is the right one. As PHP prepares the HTML document, it can access the information in the database and use this information to inject the metrics into appropriate HTML tags. PHP can also control the CSS styling of these tags, so you can set the location, size, color and other information related to the display of your metrics.
PHP is a server side scripting language where the code runs on the webserver and sends the output to the browser(as HTML)
http://php.net/manual/en/intro-whatis.php
Javascript is Client side scripting language where the code runs on browser and used for performing actions on the browser.