Results 1 to 3 of 3
Jan 19, 2013, 11:59 #1
- Join Date
- Feb 2006
- Chepstow, South Wales
- 0 Post(s)
- 0 Thread(s)
Adding generated random number to image name before upload.
I have a cms that uploads data + images to a MySQL database, and I'm trying to add a random number that is generated to the image name before its uploaded.
This is what I have but I'm struggling to add $random1 to the correct bit of the code for it to work.
$random1 = substr(number_format(time() * rand(),0,'',''),0,10);
$target = "imgdata/stock/";
$target = $target . basename( $_FILES['image1']['name']);
$q=mysql_query("insert into stock (stock_Image) values('imgdata/stock/$pic1')") or die (mysql_error());