Ver Mensaje Individual
  #4 (permalink)  
Antiguo 11/09/2008, 01:12
jamartin
 
Fecha de Ingreso: agosto-2008
Mensajes: 42
Antigüedad: 15 años, 8 meses
Puntos: 2
Respuesta: Trabajar con $HTTP_REFERER direccion corta (Se puede)?????

usa basename()

ejemplo:

$path = "http://www.tupaginaweb.net.ve/prueba/pagina.html";
$file = basename($path);

echo $file;

esto debería imprimir "pagina.html".

Ojo que cuando $path tiene párametros GET en la url, no los corta!!.. Para ello, mejor usa lo siguiente ejemplo:

$path = "http://www.tupaginaweb.net.ve/prueba/pagina.html?param=get";
$file = basename($path);
echo $file; // debería imprimir "pagina.html=param=get"

$file_ = explode('?', $file);
$only_file = $file_[0];

echo $only_file; // debería imprimir "pagina.html"

Puedes consutar más acerca de la funcion basename en:
http://cl.php.net/manual/en/function.basename.php