Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old May 17th, 2005, 10:59 AM
story97 story97 is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hot Springs, AR, United States
Posts: 1 story97 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Determine filetype then echo text

Ok I'm a really really bad newbie here, but I'm trying like heck to learn this language.

this is a very elementary problem but I'm sure you can help.

I have an upload program written in PHP. It supports uploading many different file TYPES.

On a results page (that does define the filename) i have a couple echo lines that I wrote, so people can just copy and paste the output to a forum, and it will place the right tags for [IMG] tags, and display <img src lines below it.

My problem is that the text i describe shows up regardless of what the file type is.

So what I'm really looking for, is eith a single statement that will grab a list of file extensions and match the uploaded file.

If the extensions match, show the image code, if not, continue.

This should be pretty simple, but the problem I have, is looking at php.net anything i can see corresponding to any image extensions just points to php code on how to create and manipulate the files.

Does this make sense?

Reply With Quote
  #2  
Old May 21st, 2005, 09:55 AM
Yian Yian is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: UK
Posts: 279 Yian User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Determine filetype then echo text

$type = explode("/",mime_content_type($file));
if($type[0]=="image"){
//disply html image tags
}

And this should be in the PHP section.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Determine filetype then echo text


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway