Ver Mensaje Individual
  #9 (permalink)  
Antiguo 27/07/2016, 14:59
Nedned
 
Fecha de Ingreso: enero-2015
Mensajes: 205
Antigüedad: 9 años, 3 meses
Puntos: 18
Respuesta: ¿ataque php?

Código PHP:
Ver original
  1. if (isset($_POST['url'])){
  2.     $url=$_POST['url'];
  3.    
  4.     if(strlen($url)>100)
  5.     {
  6.         header("location: index.php?v=url menor a 100 caracteres");
  7.         exit;
  8.     }
  9.     if($url=="")
  10.     {
  11.         header("location: index.php?v=Falta agregar la url");  
  12.         exit;
  13.     }
  14.      if(stristr($url,"http://")==false )
  15.      {
  16.   // AQUI  --->
  17.           if(stristr($url,"https://")==false )
  18.           {
  19.              header("location: index.php?v=La url es invalida debe ser http o https");
  20.              exit;          
  21.           }      
  22.      }  
  23. }
  24.  
  25. echo $url;


Se queda dónde te he dicho, // AQUI--->
como luego no entra en el if de más abajo no te marca tu mensaje y te muestra por pantalla el echo $url; al seguir la ejecución del código.


puedes controlarlo con un OR y juntar los dos IFs.

No se si me he explicado correctamente.