MTM2.COM

0) { echo "Return Code: " . $_FILES["file"]["error"] . "
"; echo "Return COde: " . $_FILES["pic"]["error"] . "
"; } else { echo "Upload: " . $_FILES["file"]["name"] . "
"; echo "Type: " . $_FILES["file"]["type"] . "
"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB
"; echo "Picture: " . ($newname.".".$extensionPIC) . "
"; if (file_exists("/srv/www/li520-11.members.linode.com/public_html/MTM2/Trucks/T2014/" . $_FILES["file"]["name"])) { echo "Either " . $_FILES["file"]["name"] . " or " . $_FILES["pic"]["name"] . " already exists. Files HAVE NOT been uploaded. Change the file names and try again. "."
"; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "/srv/www/li520-11.members.linode.com/public_html/MTM2/Trucks/T2014/" . $_FILES["file"]["name"]); move_uploaded_file($_FILES["pic"]["tmp_name"], "/srv/www/li520-11.members.linode.com/public_html/MTM2/Trucks/P2014/" . ($newname.".".$extensionPIC)); echo "Stored in: " . "Trucks/P2014/" . $_FILES["file"]["name"]; //This gets all the other information from the form //connect $q=$_GET["q"]; $con = mysqli_connect("localhost","www-data","uploads","dbTrucks"); if (!$con){ die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"dbTrucks"); $q = mysqli_real_escape_string($con,$q); // Save form input $truck= mysqli_real_escape_string($con, $_POST['truck']); $maker= mysqli_real_escape_string($con, $_POST['maker']); $type=$_POST['type']; $pic=($newname.".".$extensionPIC); $size=($_FILES["file"]["size"] / 1024); $zip=($_FILES['file']['name']); mysqli_query($con,"INSERT INTO trucks (truck, maker, type, size, file, dir, date, pic, pir) VALUES ('".$truck."', '".$maker."', '".$type."', '".$size."', '".$zip."', 'T2014', CURDATE(), '".$pic."', 'P2014')"); // Close connection mysqli_close($con); } } } else { echo "Either the file types are wrong or the size is too big. Please double check and try again. If the problem persists please let us know in the forum."; } ?>

Back to Front Page