Right, i can make the basic uploader in php, but i can't get it so if theres 2 files with the same name it will like add a number to one or whatever so you could keep uploading files with the same name without errors.
Anyone know how to do this ;S
Right, i can make the basic uploader in php, but i can't get it so if theres 2 files with the same name it will like add a number to one or whatever so you could keep uploading files with the same name without errors.
Anyone know how to do this ;S
You could of told me this beforeOriginally Posted by Luckyrare
![]()
LYKE OMG! TIS A LEET SITE WWW.PHP.NET K PLS?
Yeah, php.net is a good site... Just search for the function ect and ta da! Samples and tells you how to use the function.
Just check the files already in there, and if there is one of the same file name return with an error.Originally Posted by Owen
You could of told me this before
kinda quit.
<?php
function rand_array($start, $end, $rangemin, $rangemax)
{
$array = array_fill($start, $end, 1);
foreach($array as $key => $value)
{
$value = rand($rangemin,$rangemax);
print "$key: $value<br>\n";
}
}
$start = 1;
$end = 1000;
$rangemin = 1;
$rangemax = 20000;
rand_array($start, $end, $rangemin, $rangemax);
?>
Pixel Design
Pencil Design
Web Coding
Just instead of using file names, encrypt the filename into a number like 6878486.gif etc
Status:
Hmm, Graphics, you don't need that lmao
<?php
$rand = rand(1,100000);
$filename = $_POST['file'];
$upload = $file$rand;
?>
That will do the job if you make the upload form called file, and then rename the uploaded file to $upload![]()
i used to be NintendoNews. visit my blog or add me on twitter.
need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!
"I am the way, the truth, and the life. No one comes to the Father except through me"
John 14:6 (NIV)
Lol @ graphics for trying,
Like tim omgz i didnt know u knew php![]()
Want to hide these adverts? Register an account for free!