You are here: Re: Uploading using POST method « PHP Programming Language « IT news, forums, messages
Re: Uploading using POST method

Posted by ZeldorBlat on 11/19/07 15:14

On Nov 19, 10:10 am, "Bob Bedford" <b...@bedford.com> wrote:
> Hi all,
>
> I've to accept a file that is sent using a POST method.
>
> The file will be sent using this URL:
>
> http://username:p...@www.mysite.com/upload.php
>
> How can I retrieve the username and passord and rename the file ? Should I
> use substring using the URI ? Pseudocode below is the best way to do so ?
>
> <?php
> $user = substr($_SERVER['REQUEST_URI'],pos('//'),pos(':'));
> $pass = substr($_SERVER['REQUEST_URI'],pos(':'),pos('@'));
> $userid = select userid where user = $user and pass=$pass.
> renamefile($_FILES['userfile']['tmp_name'],$userid)
> ?>
>
> Thanks for help.Bob

The username will be in $_SERVER['PHP_AUTH_USER'] and the password
will be in $_SERVER['PHP_AUTH_PW'].

 

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

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