PHP Help please.

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
Post Reply
User avatar
-Legendary-




Recreator Connoisseur Renovator Mad Hatter
Snitch!

Posts: 2272
Joined: Mon Aug 02, 2004 8:06 pm
Location: SC
Contact:

PHP Help please.

Post by -Legendary- »

Ok, what I'm trying to do is this.

on Tlejftp.com, I want to only display certain codes if it's a certain file type.

First, it will always show the direct link, but if it's a Image type, (jpg, png, gif) display the BBcode for the image, and the bbcode for the Thumbnail, (which auto generates from one of my scripts.) If it was a video/music, I want to embed it, and show embed code. I know how to show all the stuff, I just can't figure out how to only show certain things, for certain file types.


It would be something like

if $filetype == "jpg"
{
echo (all my codes that I want to display for jpg..)
}

I don't know how to get the file type, but I have tried several ways and none seem to work.

Thanks if you can help!
Image
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Re: PHP Help please.

Post by Prey »

http://www.w3schools.com/php/php_if_else.asp

Unless you were after how to actually get the uploaded file's type?..
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

Legendary doesn't understand the concept of adapting variables to match what they are in his actual script. If $filetype isn't the variable the script uses (Or in the case I gave you, $filename), then it obviously won't work. It's a very simple substring function to get the file type. I showed you that. The reason it doesn't work is because of the variable names. It helps to have PHP knowledge when coding a PHP script. :|
User avatar
-Legendary-




Recreator Connoisseur Renovator Mad Hatter
Snitch!

Posts: 2272
Joined: Mon Aug 02, 2004 8:06 pm
Location: SC
Contact:

Post by -Legendary- »

No, you gave $filetype, and the script also used $filetype.
Image
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

So if it's already giving that in the script, what is the problem?
Post Reply