<?php include("db.php"); ?>
<form action="addf.php?act=add" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="50000000">
Upload File: <input name="frmFile" type="file"><br />
Version: <input type="text" name="version" id="version"><br />
Description: <input type="textarea" name="desc" id="desc"><br />
<input type="submit" value="Upload">
</form>
<?php
if($act == 'add') {
if(!(copy($_FILES['userfile']['tmp_name'], "/public_html/ArcaneLandsV2/client/" . $_FILES['userfile']['name']))) die("Unable to upload file. <a href='admin.php'>Return to admin panel</a>");
echo("File is valid, and was successfully uploaded. <a href='admin.php'>Return to admin panel</a>");
echo("<br /><br />Version: $version<br />Description: $description<br />File: $file<br />Date: $date");
$id = $_POST['id'];
$version = $_POST['version'];
$description = $_POST['desc'];
$file = basename($_FILES['userfile']['tmp_name']);
$date = date("jS F, Y");
mysql_query("INSERT INTO client (id, version, description, file, date) VALUES ('$id', '$version', '$description', '$file', '$date')") or die( mysql_error() );
}
?>
Everything works except it doesnt upload the file. The mysql query wasnt working and the file upload was, then I fixed the mysql query, and now the file upload doesnt work. If someone could help me I would be very grateful. This code has been extremely annoying. Thanks in advanced.
