Insertion upon upload

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all, 
I have a simple upload form. 

///######################## upload.php ###### 

<form enctype="multipart/form-data" method="post"
action="process.php?tsk=<?php echo $tsk; ?>"> 
<p><strong>File to Upload:</strong><br> 
<input type="file" name="img1" size="30"></p> 
<P><input type="submit" name="submit" value="Upload File"></p> 
</form> 

//##################################### 

Which loads up a process page. 

//################## process.php ########### 


<?php 
if (is_uploaded_file($_FILES['img1']['tmp_name'])) 
{ 
$filename = $_FILES['img1']['tmp_name']; 
print "$filename was uploaded successfuly"; 
$realname = $_FILES['img1']['name']; 
$fnme = $realname; 
copy($_FILES['img1']['tmp_name'], "/Inetpub/wwwroot/_tasks/images/" .
$realname); 
$flctn = "/Inetpub/wwwroot/_tasks/images/"; 
$fid = $tsk; 
} 
else 
{ 
echo "Possible file upload attack: filename" . 
$_FILES['img1']['name'] . "."; 
} 

?> 

//#################################### 

The upload works great. But I need to pass the three variables created
in the above code to a table "files" in the database. 

$fnme 
$fid 
$flctn 

Any ideas on how to incorporate an insertion method into the code
above?? 

Cheers

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux