Hi!
Try to globalize the $include_path variable:
function is_cache($get_file) {global $include_path; ... }
bagheera
Mag wrote:
Hi, I am going crazy with this function please have a look at it and tell me what i am doing wrong.
This is my setup: I have a file called one.html.cache in the directory /cache/
in one.html.cache I have a time()+ 3600 number (eg: 1096224755)
I need to know if the number in that file is still bigger than the present time() or not
the problem is, it is always returning zero...
heres the function:
echo "b".is_cache("one.html");
function is_cache($get_file) { $th_file = $include_path.$get_file . '.cache'; $fp = fopen($th_file, 'a+'); fseek($fp, 0); $rd = fread($fp, filesize($th_file)); fclose($fp); if (time() - $rd > 5) return 0; else return 1; }
What am i doing wrong? or is there a better way of doing this?
Thanks, Mag
===== ------ - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-)
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

