You can use the machine (computer) unique code + upload IP + current timestamp + GUID (+ random number), and then MD5 as the file name. The machine's unique code has the CPU information of the computer and the MAC address, both of which need to be obtained under the Linux or Unix system.
Get CPU information from your computer
function Onlyu () {
$a = ";
$b = Array ();
if (function_exists (' exec ')) {
if (mailto:[email protected](/all ", $b)) {
return false;
}
}elseif (function_exists (' system ')) {
Ob_start ();
if (mailto:[email protected](/all ")) {
return false;
}else{
}
$b = Ob_get_contents ();
Ob_end_clean ();
$b = explode ("\ n", $b);//print_r ($b);
Array_pop ($b);
}else{
return false;
}
$all = sizeof ($b);
for ($i = 0; $i < $all; $i + +) {
if (Strpos ($b [$i], "Description")!== false) {
if (Strpos ($b [$i +1], "physical Address")!== false) {
$c = Explode (":", $b [$i +1]);
$a = Trim ($c [1]);
Break
}
}
}//End for
return empty ($a) false: $a;
}//End function Onlyu
Get the address of the MAC for the NIC
function Getmac () {
@exec ("Ipconfig/all", $array);
for ($Tmpa; $Tmpa <count ($array); $Tmpa + +) {
if (eregi ("Physical", $array [$Tmpa])) {
$mac =explode (":", $array [$Tmpa]);
return $mac [1];
}
}
}
Generate a GUID string
function guid ($separated = True) {
if (function_exists (' Com_create_guid ')) {
$charid = substr (Strtolower (Com_create_guid ()), 1,-1);
if (! $separated)
Return Str_replace ('-', ', $charid);
Else
return $charid;
} else {
Generate a random MD5 string and then divide to get the GUID
Mt_srand (Double) microtime () * 10000);
$charid = MD5 (Uniqid (rand (), true));
}
if (! $separated) {
return $charid;
}
$hyphen = Chr (45);
$uuid = substr ($charid, 0, 8). $hyphen. SUBSTR ($charid, 8, 4). $hyphen. SUBSTR ($charid, 12, 4). $hyphen. SUBSTR ($charid, 16, 4). $hyphen. SUBSTR ($charid, 20, 12);
return $uuid;
}
MD5 as the file name. The machine's unique code has the CPU information of the computer and the MAC address, both of which need to be obtained under the Linux or Unix system.