Is there a way I can write a form that captures username and password and sends it to an ftp server?
I know I could do a submit and do something like ftp://$username:$password@ftp.domain.com
But wondering if there are any other ways...
Thanks in advance,
Dan
Can I use Forms to get username and passwords for FTP?
Moderator: General Moderators
FTP Form username and password
This is going back to the same problem as the....if this browser do this....if that browser do that. I just thought maybe there was a way I could submit username and password to a FTP and get in other than in the URL or maybe there are some specail charcters i can use in the URL?
My employeer wants a link to his FTP server on his site. Well I cannot just put a link because it tries to login annonymously. If i supply a username it prompts me for a password and then i can enter on and get in. Problem is my username has an @ (user@domain.com) in it which throws off IE and Firefox. I can use a + (user+domain.com) instead but that only works on IE, Firefox doesn't like it. So instead of codeing if else statements based on the hundreds of browsers out there was wondering if i could send the username and password to the FTP site through form submission.
Basically i am looking for a way to always force a prompt for login information for the FTP server coming through the website. I know this is tough because of the different browsers but that is why i am on the forums asking about it
Thanks,
Dan
My employeer wants a link to his FTP server on his site. Well I cannot just put a link because it tries to login annonymously. If i supply a username it prompts me for a password and then i can enter on and get in. Problem is my username has an @ (user@domain.com) in it which throws off IE and Firefox. I can use a + (user+domain.com) instead but that only works on IE, Firefox doesn't like it. So instead of codeing if else statements based on the hundreds of browsers out there was wondering if i could send the username and password to the FTP site through form submission.
Basically i am looking for a way to always force a prompt for login information for the FTP server coming through the website. I know this is tough because of the different browsers but that is why i am on the forums asking about it
Thanks,
Dan
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
try to rawurlencode() the username and password
as an example:outputs
as an example:
Code: Select all
$username = 'smee@foo.com';
$password = 'floob';
$domain = 'ftp.foo.com';
echo rawurlencode($username).':'.rawurlencode($password).'@'.$domain;Code: Select all
smee%40foo.com:floob@ftp.foo.com