This is a discussion on php - read filename extension in database within the Coding Help forums, part of the Webmaster Help category; Hi, I wonder if anyone can help me with this. I have a recordset to get the names of files ...
| |||||||
| Register | Forum Rules | FAQ | Donate | Calendar | Search | Today's Posts | Mark Forums Read |
| |||||
| Hi, I wonder if anyone can help me with this. I have a recordset to get the names of files to download, these are mostly PDFs so I have added the code to output a PDF file. If the file is not pdf I want to output it in the correct format. So PHP Code: Thanks
__________________ The cure for boredom is curiosity. There is no cure for curiosity - Dorothy Parker |
| |||||
| You can use filetype function available in php PHP: filetype - Manual or you can check for the ".pdf" using stristr PHP: stristr - Manual
__________________ :. Web Design & Development Web Design Ireland :. Search Engines Optimization Search Engines Optimization :. Car Parts & Accessories Car Parts :. Cars Ireland Cars Ireland :. I Have 2 Find It Directory SEF Directory |
| |||||
| Thanks Louie, I found a solution that works - here it is in case anyone else needs it: if(strtolower(substr($row_rsFilelist['filename'], strlen($row_rsFilelist['filename'])-3)) == 'pdf')) |
| Tags |
| database, download, extension, filename, pdf, php, read |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read before posting domains for sale | blacknight | Domains For Sale | 2 | 11-04-2008 02:53 PM |
| Do you read AUP / TOS before signing up? | blacknight | Hosting | 14 | 05-02-2008 03:21 PM |
| Harry Potter - Will you read it? | blacknight | Off topic discussion | 1 | 19-07-2007 03:39 PM |
| ||||
| | ![]() | |||
| | ||||