What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » php/mysql review database

php/mysql review database
Author: Message:
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: php/mysql review database
quote:
Originally posted by leejeffery
well i learnt how 2 upload files (quite easy) but now i need to know how 2 limit the file type using php if this is possible
I assume you want to limit files based on their extensions? Here's some simple example code...

code:
<?php

$filename = "uploaded.txt";

$extension = substr(strrchr($filename, "."), 1);

if($extension == "php" || $extension == "php3") {
    die("That file type is banned!");
}

?>

Or if you want to allow only certain types...

code:
if($extension != "jpg" && $extension != "gif") {
    die("Only .jpg and .gif files are allowed!");
}

Of course, the $filename line has to be removed, and then on the line below that, you need to replace $filename with whatever variable your script uses.
08-08-2004 09:17 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
php/mysql review database - by Eljay on 08-07-2004 at 02:30 PM
RE: php/mysql review database - by Concord Dawn on 08-07-2004 at 03:40 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 09:00 AM
RE: php/mysql review database - by WDZ on 08-08-2004 at 09:17 AM
RE: php/mysql review database - by Eljay on 08-08-2004 at 09:39 AM
RE: php/mysql review database - by musicalmidget on 08-08-2004 at 10:39 AM
RE: php/mysql review database - by Eljay on 08-08-2004 at 12:20 PM
RE: php/mysql review database - by bach_m on 08-08-2004 at 03:20 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 04:02 PM
RE: php/mysql review database - by bach_m on 08-08-2004 at 05:36 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 05:43 PM
RE: php/mysql review database - by bach_m on 08-08-2004 at 06:04 PM
RE: php/mysql review database - by Eljay on 08-08-2004 at 06:16 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On