RTS Posted August 19, 2006 Share Posted August 19, 2006 how do I make it so html, and php are not accepted on my upload form? Quote Link to comment Share on other sites More sharing options...
corbin Posted August 19, 2006 Share Posted August 19, 2006 Im not very good with upload script but it would look something like$filename_array = explode(".", $filename);$c = count($filename_array);if($filename_array[$c] == "php") { die("error message"); }Oh... hostfreak posted while i was typing this hmmm... Im not sure if RTS meant a script to upload files or submit data... Quote Link to comment Share on other sites More sharing options...
hostfreak Posted August 19, 2006 Share Posted August 19, 2006 Oh, crap... Sorry I mis-read the OP's question. Removed the post. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted August 19, 2006 Share Posted August 19, 2006 [quote author=corbin link=topic=104840.msg418403#msg418403 date=1155968836]Im not very good with upload script but it would look something like$filename_array = explode(".", $filename);$c = count($filename_array);if($filename_array[$c] == "php") { die("error message"); }Oh... hostfreak posted while i was typing this hmmm... Im not sure if RTS meant a script to upload files or submit data...[/quote]Infact it should be: [code]$filename_array = explode(".", $filename);$c = count($filename_array)-1;if($filename_array[$c] == "php") { die("error message"); }[/code] since the keys start with 0 and not 1. This will only check the extension. If you wan't to check if it actually contains PHP codes, then it would be more difficult. Quote Link to comment Share on other sites More sharing options...
corbin Posted August 19, 2006 Share Posted August 19, 2006 Hehe yeah forgot it starts with 0... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.