What you have is essentially that. It in theory should work; however, I do know that most FTP servers will allow you to log in with this type of url:
ftp://[color=red]username[/color]:[color=red]password[/color]@[color=red]domain.tld[/color]
So for example:
[url]ftp://root:password@myhost.com[/url]
You would then log in with the credentials of "root".
One way to achieve this is to use the [man]header/man function and send them there on your own:
<?php
if(isset($_POST) && !empty($_POST))
{
$url = 'ftp://%s:%s@' . $_SERVER['HTTP_HOST'];
$user = $_POST['ftpUserName'];
$pass = $_POST['ftppassword'];
$url = sprintf($url, $user, $pass); // Replace the %s's with proper values
header('Location: ' . $url);
}
else
{
// Show the form:
echo <<<HTMLFORM
<html>
<head>
<title>Login</title>
</head>
<body>
<form name="loginCustom" method="post" action="ftp://ftp.ftpSiteExemple.com" id="loginCustom">
<input type="text" name="ftpUserName" size="50" MAXLENGTH="50" />
<input type="password" name="ftppassword" size="50" MAXLENGTH="50" />
<input type="submit" id="submitButton" value="Login" />
</form>
</body>
</html>
HTMLFORM;
}
Now that's just an example, but something like that should work.