You are here: Re: Security solution needed for file uploader code « All PHP « IT news, forums, messages
Re: Security solution needed for file uploader code

Posted by Matt F on 09/28/33 11:45

Kerry,
While I don't see how this code works on it's own, I'll assume it's
just a segment. There is a superglobal variable that you can use in PHP
called $_FILE. If you write an HTML form capable of uploading a file
then all of the data about the file can be retreieved from the $_FILE
superglobal. You can find more information on this on the PHP website.
I've pasted the think below. Good luck with your project.

http://us3.php.net/manual/en/features.file-upload.php

Matt

Kerry wrote:
> Hi,
>
> I use the simple PHP script below with an html file for my visitors to
> upload files.
>
> I'd like to make it more secure by either allowing or denying certain files.
> I've tried adding more code but I can't get anything to work.
>
> I'm not an expert, but know it's probably only a couple of simple lines of
> code that will do the trick.
>
> TIA to anyone that can offer a solution.
>
> Kerry
>
> <?php
>
> if ($img1_name != "") {
>
>
> @copy("$img1" , "/home/mysite/myfolder/uploader/$img1_name")
>
>
> or die("Couldn't Upload Your File.");
>
> } else {
>
> die("No File Specified");
>
> }
>
> ?>
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация