This topic is locked

Fatal error: Call to undefined function: file_get_contents()

3/22/2006 8:52:35 PM
PHPRunner General questions
K
ke5rs author

Hello again,

Everything was working fine so I thought I would add an image option for user to upload their picture.
Now I get
Fatal error: Call to undefined function: file_get_contents() in /var/www/html/ares/users/include/members_functions.php on line 1253+
Here is line 1253

$ret=file_get_contents($file['tmp_name']);
This happens after a jpg image is selected and the user presses 'Save'
Using default template

cell is BLOB type.
Any ideas?
Thanks...

John

admin 3/23/2006

Hi,
file_get_contentsfunction appeared in PHP 4.3.0 only.

So either upgrade your PHP or add the following code to the end of include\dbcommon.php file:

function file_get_contents($filename)

{

$handle = fopen($filename, "rb");

$contents = fread($handle, filesize($filename));

fclose($handle);

return $contents;

}


We'll resolve this issue in the next PHPRunner version.
BTW, you should use Database image View and Edit type instead of Document uploadfor BLOB field.

K
ke5rs author 3/23/2006

Hi,

file_get_contentsfunction appeared in PHP 4.3.0 only.

So either upgrade your PHP or add the following code to the end of include\dbcommon.php file:
We'll resolve this issue in the next PHPRunner version.
BTW, you should use Database image View and Edit type instead of Document uploadfor BLOB field.


Thank you

That fixed it...

John