Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

roundcube login using curl

Discussion in 'General Discussion' started by Anupam Baruah, Oct 19, 2011.

  1. Anupam Baruah

    Anupam Baruah Registered

    Oct 18, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Website Owner
    Myself anupam baruah.I want to login roundcubemail directly from drupal 7.8.In this case drupal username and password must be same as roundcube username and,.....when i log into drupal7 automaticalyy login to roundcubemail using same login info....i have used curl for roundcube login.but it does not work properly......
    plese help me.....

    below i attached curl code for roundcubelogin....

    //echo $user;
    $url = "http://localhost/roundcubemail/";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url); // set url to post to
    curl_setopt($ch, CURLOPT_FAILONERROR, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); // allow redirects
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); // return into a variable
    curl_setopt($ch, CURLOPT_TIMEOUT, 0); // times out after Ns
    curl_setopt($ch, CURLOPT_POST, 1); // set POST method
    curl_setopt($ch, CURLOPT_POSTFIELDS, "_user=".$user1."&_pass=".$password."&ajax=1&_action=login"); // add POST fields
    curl_setopt($ch, CURLOPT_FAILONERROR, 0);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_HEADER, 1);
    curl_setopt($ch, CURLOPT_COOKIEFILE, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    curl_exec($ch); // run the whole process
    // drupal_goto($url);
    #1 Anupam Baruah, Oct 19, 2011
    Last edited by a moderator: Oct 19, 2011

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice