Insertion upon upload

From: Date: Sun, 12 Jan 2003 22:23:25 +0000
Subject: Insertion upon upload
Groups: php.db 
Request: Send a blank email to php-db+get-24795@lists.php.net to get a copy of this message
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

« previous php.db (#24795) next »