I think this will work:
<?php
$foldername = "uploads/partsbase/";
//-- Connection Settings
$ftp_server = "pentagonposts.partsbase.com"; // Address of FTP server.
$ftp_user_name = "pentagonposts"; // Username
$ftp_user_pass = 'password'; // Password
$destination_folder = ""; //where you want to throw the file on the webserver (relative to your login dir)
$conn_id = ftp_connect($ftp_server) or die("<span style='color:#FF0000'><h2>Couldn't connect to $ftp_server</h2></span>"); // set up basic connection
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass) or die("<span style='color:#FF0000'><h2>You do not have access to this ftp server! /h2></span>"); // login with username and password, or give invalid user message
if ((!$conn_id) || (!$login_result)) { // check connection
// wont ever hit this, b/c of the die call on ftp_login
echo "<span style='color:#FF0000'><h2>FTP connection has failed! <br />";
echo "Attempted to connect to $ftp_server for user $ftp_user_name</h2></span>";
exit;
} else {
//echo "Connected to $ftp_server, for user $ftp_user_name <br />";
}
$files = array_slice(scandir($foldername), 2);
for ($x=0; $x<sizeof($files); $x++) {
$upload = ftp_put($conn_id, $destination_folder . $files[$x], $foldername . $files[$x], FTP_BINARY); // upload the files
if (!$upload) { // check upload status
echo "<span style='color:#FF0000'><h2>FTP upload of " . $files[$x] . " has failed!</h2></span> <br />";
} else {
echo "<span style='color:#339900'><h2>Uploading " .$files[$x] . " Completed Successfully!</h2></span><br /><br />";
}
}
ftp_close($conn_id); // close the FTP stream
?>