PDA

View Full Version : Create FTP account via CURL



aminulsumon
04-04-2008, 12:17 AM
I want to create FTP account by php code. The steps are as:

First i login my control panel www.shopno-dinga.com:2082/cpanel
For this i use the following code:-

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, "http://shopno-dinga:2082/cpanel/");
// I also tried http://shopno-dinga:2082/login/
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$result = curl_exec($ch);
curl_close($ch);
echo $result;

But it display the login page with user name and password text box. I don't even get any error like: invalid username and password. It means my values are not submitted yet.

Secondly, is it possible to create FTP account through CURL?

I am looking forward for a solution or better advice.
Thanks,
Md. Aminul Islam

felgall
04-04-2008, 03:09 PM
Why are you trying to create an extra FTP account?

Unless you need an FTP account to give to someone doing development work for you so as to restrict their access to a specific folder there is no real need for additional FTP accounts as you can always use the master FTP login supplied with your hosting. If you are creating one for a developer it is most easily done via the option in cPanel.

I can't understand why you would ever need to be able to create one via a script and so have never investigated whether it would be possible to do so.

Basil
04-09-2008, 03:07 AM
http://bluehostforum.com/showpost.php?p=47275&postcount=3