Detect what filetype being display Detect what filetype being display
 

News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Detect what filetype being display

Started by dreams83, September 14, 2006, 09:14:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dreams83

How do you detect if and MP3 file is being played or an JPEG file is being viewed?
Is there a variable in cpg that will tell what type of file is being view?

Because what I want is something like this

if ( file being view is mp3 ) {
    I want to display extra stuff here.
    //I think I know what to do here but I don't know how to detect the file type.
}
else
    do nothing



If you guys could point me in the right direction that would be cool.

Nibbler

Depends where you are using the code. Post details.

dreams83

i think in the intermediate display image part.

I only want to show the highlighted part if it is a mp3 file, but I don't know how to detect if it is or not.

dreams83

I was able to figured out how to do it now. I just read the url and look at the extension.

Thank You