Jump to content

[SOLVED] Read file error


steviez

Recommended Posts

Hi,

 

I need to show a image inline on a php page so im using the following code:

 

<?php
header('Content-Type: image/gif');
header('Content-Disposition: inline; filename=file_not_found.gif');
readfile("/home/image/public_html/images/file_not_found.gif");
?>

 

Even though the image is there and the image displays correctly im getting the following error:

 

[09-Jul-2008 16:41:01] PHP Warning:  readfile(/home/image/public_html/images/ewz8q9lvspdfevpc0k3.jpg) [<a href='function.readfile'>function.readfile</a>]

 

Any ideas whats wrong?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/114010-solved-read-file-error/
Share on other sites

If your code does what you want it to do, simply use

 

<?php
header('Content-Type: image/gif');
header('Content-Disposition: inline; filename=file_not_found.gif');
@readfile("/home/image/public_html/images/file_not_found.gif");
?>

 

That seems to have worked thanks, what does the @ symble do at the beggining of php code?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.