';
include_once('ftpconnect.php');
ftpconnect();
if ($ftpconn) {
$ftpdoc = tmpfile();
if (!$ftpdoc) {
$ftpdocp = tempnam(dirname(__FILE__) . '/../settings/tmp', 'Ftpdoc');
chmod($ftpdocp, 0777);
$ftpdoc = fopen($ftpdocp, 'w+');
}
fwrite($ftpdoc, $ftpvars);
rewind($ftpdoc);
$path = urldissect($_SERVER['SCRIPT_NAME'], false, 1);
$remotefile = $ftpwd . $path . 'ftpvars.php';
if (ftp_fput($ftpconn, $remotefile, $ftpdoc, FTP_BINARY)) {
$getmessage = "Your FTP information was successfully saved.";
$savescript = '';
echo $savescript;
} else {
$getmessage = "Error: There is an error in your FTP credentials. Please try entering them again.";
$savescript = '';
echo $savescript;
}
fclose($ftpdoc);
if (isset($ftpdocp)) unlink($ftpdocp);
}
echo '';
} else {
$getmessage = 'Error: All fields are required.';
$savescript = '';
echo $savescript;
echo '';
}
}
}
?>