php-general | 2001032
Date: 03/24/01
- Next message: JJeffman: "[PHP] Re: [PHP-DB] connection id"
- Previous message: Tony Daniels: "[PHP] Very Easy Help Needed Quick!"
- In reply to: Randy Johnson: "[PHP] random letters and numbers"
- Next in thread: Joe Stump: "Re: [PHP] random letters and numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I use a random password function to do just that,
function randomPassword($length = 8) {
// all the chars we want to use
$all = explode( " ",
"a b c d e f g h i j k l m n o p q r s t u v w x y z "
. "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z "
. "0 1 2 3 4 5 6 7 8 9 _");
for($i=0;$i<$length;$i++) {
srand((double)microtime()*1000000);
$randy = rand(0, 61);
$pass .= $all[$randy];
}
return $pass;
}
$new_filename = randomPassword(10);
For the delete of the file, unlink is your answer:
http://www.php.net/manual/en/function.unlink.php
hope it help!
py
At 12:05 PM 3/24/01 -0500, you wrote:
>Is there an easy way to create random numbers and letters for a file example
>
>
>http://www.mydomain.com/1w2e3rff.txt
>
>and then after they download it have it be deleted off the server?
>
>
>thanks
>
>randy
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-general-unsubscribe <email protected>
>For additional commands, e-mail: php-general-help <email protected>
>To contact the list administrators, e-mail: php-list-admin <email protected>
+ ======================
+ Pierre-Yves Lem <email protected>
+ E-MedHosting.com
+ (514) 729-8100
+ pylem <email protected>
+ ======================
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: JJeffman: "[PHP] Re: [PHP-DB] connection id"
- Previous message: Tony Daniels: "[PHP] Very Easy Help Needed Quick!"
- In reply to: Randy Johnson: "[PHP] random letters and numbers"
- Next in thread: Joe Stump: "Re: [PHP] random letters and numbers"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

