Blank page when using mime_content_type()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
webgroundz
Forum Commoner
Posts: 58
Joined: Thu Jun 21, 2007 1:20 am
Location: Philippines

Blank page when using mime_content_type()

Post by webgroundz »

I want to get the type of a file using mime_content_type()
im using PHP Version 5.2.2
here's my sample code:

Code: Select all

echo mime_content_type('wg_logo.gif');
but the result page is blank!

what do you think is the problem?.

thanks all... :) :) :)
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Blank page when using mime_content_type()

Post by John Cartwright »

Is that the only thing in the page? If not, that usually means you have a parse error.

What does

Code: Select all

var_dump(mime_content_type('wg_logo.gif'));
var_dump(function_exists('mime_content_type'));
yield?

Reguardless, the function is deprecated. You should be using fileinfo instead
User avatar
webgroundz
Forum Commoner
Posts: 58
Joined: Thu Jun 21, 2007 1:20 am
Location: Philippines

Post by webgroundz »

thanks Jcart, it works fine... :D :D :D
Post Reply