Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Test your ping</title>
- </head>
- <body>
- <?php
- $ip_en_cours = $_SERVER["REMOTE_ADDR"];
- $pinginfo = exec("ping -c 2 $ip_en_cours | tail -1| awk '{print $4}' | cut -d '/' -f 2");
- ?>
- <img src="fr.gif" alt="French flag" /> Roubaix, France
- <?php
- if ($pinginfo<70) {
- echo "<font color=\"green\"><strong>$pinginfo ms</strong></font>";
- }
- elseif ($pinginfo>70 && $pinginfo<100) {
- echo "<font color=\"orange\"><strong>$pinginfo ms</strong></font>";
- }
- else {
- echo "<font color=\"red\"><strong>$pinginfo ms</strong></font>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement