im using the following script http://www.phpbuilder.com/snippet/detail.php?type=snippet&id=709 for uploading / downloading files etc , however i need to modify it so it updates my members db and puts file location in the the users record.
something like this
mysql_query("UPDATE members SET file=$absolute_path/$file_name$uname WHERE uid='$uid'");
but how do i put that into this script any help?
the section of the script need to modify is this
<title>File Upload</title>
</head>
<body>
<form method=POST action=$PHP_SELF?x=cfg&action=douploadcfg enctype=multipart/form-data>
<p>File to upload:<br>
<input type=file name=file size=30>
<p><button name=submit type=submit>
Upload
</button>
</form>
<br><br>
Powered by <a href=http://www.zachwhite.com/>PHP Uploader Downloader</a>
</body>
</html>";
break;
//File Upload
case "douploadcfg":
$dir = "dir$uname";
if ($file != "") {
if (file_exists("$absolute_path/$file_name$uname")) {
die("File already exists");
}
if (($sizelimit == "yes") && ($file_size > $sizebytes)) {
die("File is to big. It must be $sizebytes bytes or less.");
}
$ext = strrchr($file_name,'.');
if (($extlimit == "yes") && (!in_array($ext,$limitedext))) {
die("The file you are uploading doesn't have the correct extension.");
}
@copy($file, "$absolute_path/[$uname]$file_name") or die("The file you are trying to upload couldn't be copied to the server");
} else {
die("Must select file to upload");
}
echo "
<html>
<head>
<title>File Uploaded</title>
</head>
<body>";
echo $file_name." was uploaded";
echo "<br>
<a href=$PHP_SELF?x=cfg&action=uploadcfg>Upload Another File</a>
<a href=$PHP_SELF?x=cfg&action=downloadcfg> Download File</a>
<a href=$websiteurl> Return to $websitename</a><br><br>
Powered by <a href=http://www.zachwhite.com/>PHP Uploader Downloader</a>
</body>
</html>";