On one of my sites I get the error message: Call to undefined function: file_get_contents() A header checker says: HTTP/1.1 200 OKDate: Tue, 02 Nov 2004 13:29:00 GMTServer: Apache/1.3.27 (Unix) (Red-Hat/Linux) Chili!Soft-ASP/3.6.2 mod_ssl/2.8.14 OpenSSL/0.9.6b PHP/4.1.2 FrontPage/5.0.2.2510X-Powered-By: PHP/4.1.2Connection: closeContent-Type: text/html So I searched through this forum and found a hack. However, when I add the hack I now get: Fatal error: Cannot redeclare file_get_contents() How wierd is that - can anyone help please.
undefined indicates the PHP version is too low and doesn't support that function. redeclare problem would indicate you are either including the function twice, hence trying to redeclare it but impossible to do so. Or you are looping through a while or for loop and 'jump up' in the script to above the function, thus trying to redeclare it again. My guess is you are inclduing a file with that (compat?) function multiple times. Break the function out of that code and include it just once above all the others.
Thanks TOPS30 Of course... as I am running 5 ads I am calling ad_network.php 5 times and declaring the function each time. Moving it into an include file didn't work though as it also is being included 5 times. Any good ideas? inserted: Thanks for your help - I have fixed it now. Basically I used Shawn's hack for users of < php4.3 - but as I was running 5 ads it was trying to define file_get_contents more than once. I have moved Shawn's hack to a file named ads_include.php and added the following to ads_network.php include_once ('ads_include.php') and its now working OK