Welcome to my video
In this video I show you how to create a ping monitoring with PHP and you can monitor from anywhere
I will do with one IP address that successfully pinged and one IP address that failed
In this video, I use XAMPP to run a PHP Web server
Start Mysql and Apache servers
To write PHP commands I use NotePad plus plus
Create a file .php to htdocs
You can also create any folders inside htdocs folder and save our codes over there
In this video, I will go step by step, first execute ping command with ip address and give success or failure result
If the result is 0, the ping command is successful, the rest is failed
Next, do this with multiple ip addresses and get the results for each
You use an array to hold the list of ip addresses
Next do this for each of the IP addresses in that array and get the result
One success and one failure
You will be more convenient if you know the name of each ip address
Therefore, you add a description for each ip address
Therefore you use a two-dimensional array array to contain a list of your IP addresses
include ip address and name, you customize it at your disposal
Next, ping each ip address and get the result
As you can see, for easy viewing there is a need to have a table containing the results
The table is created with 4 columns, containing the information: ip address, results, description
Results
Description
If successful, you will receive online results
If it fails, you will get offline result
You should fix it a bit more beautiful
You edit the text online to be green
You edit the text offline to be red
Next, you correct to automatically update the results after a specified period of time
In this video, the website will automatically update results every five seconds
If you want to monitor from anywhere, you need to open the port on the router
You change Apache's default port from 80 to 81
Next open the port on your router
port 81 and the ip address of the computer where xampp is installed
And now you can monitor from anywhere, even on your phone
Thanks for watching don't forget to like and subscribe