View Single Post
  #4 (permalink)  
Old 01-16-04, 02:42 PM
therat's Avatar
therat therat is offline
Newbie Coder
 
Join Date: Jan 2004
Location: London
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
I now have the files being renamed correctly by adding the following.

PHP Code:

$new_file substr(sha1(rand(10time())), 08) . '.' $file_types[$filetype]; 

if (
move_uploaded_file($tempname$upload_dir $new_file)); 
How do i now get the 2 new names and store them in the database. At the moment the insert query looks like this

PHP Code:

$thumb $new_file;

$archive $new_file;
$zipmime $up_files['type'][1];

$query "INSERT INTO skinz_images (image_thumb_file,image_download_url) VALUES ('$thumb',$archive','$zipmime')";
$result mysql_query($query$skinz) or die(mysql_error());
mysql_close(); 
This is located right at the ned of the script. Is this the best place for it or, should it be moved inside the actual uploading part.
Reply With Quote