PHP and Javascript for resolution, IP, time


This script shows the resolution of Browser in smartphone, tablet or PC window that you can use for your homepage.


Author: created on 2017-12-22


PHP and Javascript for resolution, IP, time
Image: Sylbek 2017


Smartphone friendly website

During the the homepage adaptation for mobile it was always necessary to have the screen width in view. Therefore, the corresponding line for the width and height has been inserted in Javascript, see below.

Explanation: Textarea can be often enlarged (bottom right corner), mark the content with CTRL+A and copy to the clipboard with CTRL+C.


Then it was necessary that the values change automatically when window is changed or smartphone/tablet is rotated. To measure the page width, every second was the idea. Why not have the time with it in view?

Finally, I found this feature useful and I have also switched online (see Sylbek bottom right). If you find it useful, you can also integrate it into your website. Below is the guide.

Javascript (showinfo.js) includes:


Time function, resource saving version

The time is from the web server, not the local device. This time is read with every click via PHP (page load). Then only seconds are counted via Javascript function until the next click. This is resource-saving variant.

The related PHP page (showinfo.php) contains:



If you load these two files on your PHP server you will see a result.

Below you can see the compact version, everything in one file:





Any Questions?
☏ +49​ 721​ 66980​ 610


Write to us,
you can expect an answer on the same or next working day.



This message is being sent encrypted



Consulting, Support & Security
  ✅ M365 & Azure Cloud Migrations
  ✅ Tenant Security Audits & Reviews
  ✅ Managed Services & Workplace Hardware
  ✅ IT Modernization & Flat-Rate Support

Microsoft 365 Licenses
  ✅ Over 20 Years of IT Experience & Microsoft Partner
  ✅ License Optimization & Consulting
  ✅ Fast License Provisioning for Business Customers
  ✅ Payment by Invoice for Business Customers