|
Posted by Bob Bedford on 11/19/07 15:10
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:pass@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
[Back to original message]
|