Foro de elhacker.net

Programación => PHP => Mensaje iniciado por: 2Fac3R en 29 Julio 2015, 20:57 pm



Título: [PHP] Is online? v3.0 (tool)
Publicado por: 2Fac3R en 29 Julio 2015, 20:57 pm
Con la idea de seguir mejorando los códigos, les comparto otro que he modificado y mejorado.
Código
  1. <!DOCTYPE html>
  2. <title> Is online? v3.0 By 2Fac3R</title>
  3. <style>
  4.        body,html{
  5.                background-color:black;
  6.                color:green;
  7.        }
  8.        #ok{
  9.                font-weight:bold;
  10.        }
  11.        #bad{
  12.                font-weight:bold;
  13.                color:red;
  14.        }
  15. </style>
  16. <center>
  17.        <pre>
  18. .___         ________         .__  .__            _________
  19. |   | ______ \_____  \   ____ |  | |__| ____   ___\_____   \
  20. |   |/  ___/  /   |   \ /    \|  | |  |/    \_/ __ \ /   __/
  21. |   |\___ \  /    |    \   |  \  |_|  |   |  \  ___/|   |  
  22. |___/____  > \_______  /___|  /____/__|___|  /\___  >___|  
  23.         \/          \/     \/             \/     \/<___>  
  24.        </pre>
  25.  
  26. <form action="" method="POST">
  27.        URL: <input type="text" name="page" value="http://">
  28.        <input type="submit" name="send" value="Comprobar!">
  29. </form> <br> <i>By 2Fac3R</i> <br> <br>
  30.  
  31.  
  32. <?php
  33. /*
  34.                 ¿Is online? 3.0 By 2Fac3R
  35.         Verificar si un servidor web esta online
  36.                                                                                          */
  37.  
  38. function verificar($url)
  39. {
  40.    $url = htmlentities($url);
  41.        if(filter_var($url,FILTER_VALIDATE_URL) or filter_var($url,FILTER_VALIDATE_IP)){
  42.                echo fopen($url,'r') ? "$url <div id='ok'>Online</div>" : "$url <div id='bad'>Offline</div>";
  43.        }else{
  44.                echo '<script>alert("URL/IP no valida!");window.location=""</script>';
  45.        }
  46. }
  47.  
  48.  
  49. if(!empty($_POST['page'])){
  50.     verificar($_POST['page']);
  51. }
  52. ?>
  53.  
  54. <br><b>Gr33tz to:</b> <br> <br>
  55.  
  56.   xt3mp, arcangel_nigth, ANTRAX, 11Sep, Kr34t0r, GAMARRA, SkippyCreammy, v1c0_h4ck <br>
  57.   w4rning, Snifer, arthusu, Kodeinfect, [Q]3rV[0], WilyXem, m3x1c0h4ck, etc, etc, etc ... <br> <br>
  58.   <a href="http://www.underc0de.org"><b>Underc0de.Org</b></a>
  59.   </center>
  60.  

Espero le den utilidad.
Zalu2