Ver Mensaje Individual
  #7 (permalink)  
Antiguo 13/04/2006, 21:09
Computer XTress
 
Fecha de Ingreso: diciembre-2004
Mensajes: 721
Antigüedad: 19 años, 4 meses
Puntos: 2
Bueno todo va bien con el ejemplo UAMISTAD. Encontre en el manual de PHP.NET un script para hacer el trabajo, pero tengo un pequeño problema...

El script trabaja utilizando la funcion: filemtime(); y si PHP esta trabajando en SAFE_MODE, no permite acceder utilizar la funcion...

Primero lo primero, las funciones:
(Esto en la primera seccion del script)

Código PHP:
function get_http_mdate()
{
   return 
gmdate("D, d M Y H:i:s",filemtime('/foros/forum_buscar.php'))." GMT";
}

function 
check_modified_header()
{
   
// This function is based on code from http://ontosys.com/php/cache.html

   
$headers=apache_request_headers();
   
$if_modified_since=preg_replace('/;.*$/'''$headers['If-Modified-Since']);
   if(!
$if_modified_since)
       return;

   
$gmtime=get_http_mdate();

   if (
$if_modified_since == $gmtime) {
       
header("HTTP/1.1 304 Not Modified");
       exit;
   }
}

check_modified_header();
header("Last-Modified: ".get_http_mdate()); 
Y cuando cargo mi buscador, aparece este hermoso cartelito de error:

Warning: filemtime(): SAFE MODE Restriction in effect. The script whose uid is 2189 is not allowed to access / owned by uid 0 in /webcp/docs/webs/7645023445/test/foro/buscar.php on line 5

¿De que otra forma alternativa puedo tomar ese dato de TIEMPO que necesito para que la funcion pueda calcular utilizando IF-MODIFIED-SINCE ?

¿Tal vez alguna alternativa a filemtime() ?

MUCHAS GRACIAS