FTP with special characters in the password
Posted: Tue Mar 31, 2009 2:46 pm
Hi Everyone,
I am having a heck of a time trying to figure out how to get my php script to log into a standard ftp server. When I log into the ftp server from the command prompts - no problems at all (I know the username and password I fine). But as soon as I try from a php script -> it dies saying wrong password. The issue I believe is that there are special characters in the password -> a * ie. asterisks.
Here is what I have:
$fpt_server = 'ftp.servername.com';
// open a connection to the ftp server;
$conn_id = ftp_connect($ftp_server) or die ("Could not connect to $ftp_server");
// Open a session to an external ftp site
$login_result = ftp_login($conn_id, 'myusername','ABC*xyz123');
Do I have to escape that "*" or does anyone else have any other ideas. I have tried urlencode, I have tried ways to escape it with no luck.
Thoughts? Ideas? Suggestions?
This should be a super simple thing ... but has turned out to be a royal pain the butt.
Thanks in Advance,
Kid
I am having a heck of a time trying to figure out how to get my php script to log into a standard ftp server. When I log into the ftp server from the command prompts - no problems at all (I know the username and password I fine). But as soon as I try from a php script -> it dies saying wrong password. The issue I believe is that there are special characters in the password -> a * ie. asterisks.
Here is what I have:
$fpt_server = 'ftp.servername.com';
// open a connection to the ftp server;
$conn_id = ftp_connect($ftp_server) or die ("Could not connect to $ftp_server");
// Open a session to an external ftp site
$login_result = ftp_login($conn_id, 'myusername','ABC*xyz123');
Do I have to escape that "*" or does anyone else have any other ideas. I have tried urlencode, I have tried ways to escape it with no luck.
Thoughts? Ideas? Suggestions?
This should be a super simple thing ... but has turned out to be a royal pain the butt.
Thanks in Advance,
Kid