We help IT Professionals succeed at work.

How do I show metrics with PHP or Javascript

Jazzy 1012
Jazzy 1012 asked
on
186 Views
Last Modified: 2018-02-06
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?
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Do you want to display this metrics from the database? or Is it static information that you want to show it on the page?

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.

Author

Commented:
I want to show metrics from my database
Most Valuable Expert 2011
Author of the Year 2014

Commented:
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.

Author

Commented:
Yes but can you show me an example, Im not sure how to build a metrics with php
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Most Valuable Expert 2011
Author of the Year 2014
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions