Ver Mensaje Individual
  #8 (permalink)  
Antiguo 19/06/2008, 01:22
DarkJ
 
Fecha de Ingreso: octubre-2004
Mensajes: 2.627
Antigüedad: 20 años, 4 meses
Puntos: 48
Respuesta: Seguridad para no acceder a ver archivos?

Cita:
luego en 'verDoc.php' pondría un link:

<a href="misDocs/<?php echo $_GET['nombrePdf']; ?>">bajar pdf</a>
No, mientras dejes un link directo al fichero nunca vas a poder evitarlo.

Haz que verDoc.php devuelva el fichero pdf, algo como:
Código PHP:
<?php

// AQUI IRIA TU CODIGO DE VALIDACION DE LOGIN
// SI NO ESTA LOGEADO LE REDIRECCIONAS A LA PAGINA APROPIADA


// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>
(de www.php.net/header).