Hi,

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.

PHP Code:
$random1 substr(number_format(time() * rand(),0,'',''),0,10);

$target "imgdata/stock/";
$target $target basename$_FILES['image1']['name']);
$pic1=($_FILES['image1']['name']);

$q=mysql_query("insert into stock (stock_Image) values('imgdata/stock/$pic1')") or die (mysql_error());

move_uploaded_file($_FILES['image1']['tmp_name'], $target); 
I have tried to add $random1 all over those scripts and havent worked it out.

Thanks