This is a discussion on File Upload within the alt.comp.lang.php forums, part of the PHP Programming Forums category; My church wants to put a file upload interface on their website so that when they go off to other ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
My church wants to put a file upload interface on their website so that
when they go off to other countries they can load photos directly on to the server. I haven't done this in a while and only in CF, but if I remember correctly file upload is a pretty straight forward proceedure. The question is how to handle security? The server is on the church grounds and so the church handles it's own server setup. Also the last time I played around with PHP it was version 4.0 so all the books that I have on PHP are probably a little out of date. Not to mention that there was no mention at all about constructing a file upload page. any insight would be greatly appreciated Kevin Raleigh |
|
|||
|
Basic authentication can be done something along these lines:
<? if (!$PHP_AUTH_USER) { header ("WWW-authenticate: basic realm=\"secure area\""); header ("HTTP/1.0 401 Unauthorized"); echo "<metta http-equiv=\"refresh\" content=\"0;url=failedlogin.php\">"; exit; } ?> $PHP_AUTH_USER - username $PHP_AUTH_PW - password By default PHP will upload file to the global variable $_FILES; if the form file input tag is called "thefile" then $_FILES["thefile"] will contain an array with various items see PHP's global varibles documentation for full details. Kevin Raleigh wrote: > My church wants to put a file upload interface on their website so that > when they go off to other countries they can load photos directly on to > the server. I haven't done this in a while and only in CF, but if I remember > correctly file upload is a pretty straight forward proceedure. > > The question is how to handle security? > > The server is on the church grounds and so the church handles it's own > server setup. Also the last time I played around with PHP it was version > 4.0 so all the books that I have on PHP are probably a little out of date. > Not to mention that there was no mention at all about constructing a file > upload page. > > any insight would be greatly appreciated > Kevin Raleigh |
|
|||
|
I tried this and it works fine, but I don't know what to put for the username and password. Do I need to create a new file to store that information? On 25 Jul 2006 09:22:58 -0700, "Nyoka" <isaac.scott@gmail.com> wrote: >Basic authentication can be done something along these lines: ><? >if (!$PHP_AUTH_USER) { > header ("WWW-authenticate: basic realm=\"secure area\""); > header ("HTTP/1.0 401 Unauthorized"); > echo "<metta http-equiv=\"refresh\" >content=\"0;url=failedlogin.php\">"; > exit; >} >?> > >$PHP_AUTH_USER - username >$PHP_AUTH_PW - password > |