The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

POP account creation script. Runs fine on Win2000, not on Linux.

Discussion in 'General Discussion' started by ksingh, Nov 18, 2003.

  1. ksingh

    ksingh Active Member

    Joined:
    Mar 21, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    I posted the same matter at WHT. But as I have not been able to get my answer, I am posting it here now.

    PHP:
    <? 
    $host "hostname"
    $socket fsockopen($host,2082); 
    socket_set_timeout($socket,30); 

    $cpaneluser "cpanel_username"
    $cpanelpass "cpanel_password"
    $authstr "$cpaneluser:$cpanelpass"

    $domain "domainname"
    $email="desired_username"
    $password="desired_password"
    $quota=10

    $pass base64_encode($authstr); 
    $in "GET /frontend/bluelagoon/mail/doaddpop.html?email=$email&domain=$domain&password=$password&quota=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n\r\n"
    print 
    $in

    fputs($socket,$in); 
    fclose$socket ); 
    ?> 

    I am facing a weird problem. This is a POP account creation script. If I run it from my Win2000 PC, it creates the POP account. But when I run this script from the Linux server (CPanel is also on that server), it does not create any POP account.

    Any help will be highly appreciated.

    K Singh
     
  2. RaveKnights

    RaveKnights Well-Known Member

    Joined:
    Nov 5, 2003
    Messages:
    81
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Some Where Out There!
    Only thing I can think of is put an @ in front of fsockopen like @fsockopen

    worth a shot.
     
  3. ksingh

    ksingh Active Member

    Joined:
    Mar 21, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    No effect. For info sake on Win2000 PHP version is 4.3.1 and on Linux is 4.3.4.

    K Singh
     
  4. nconroy

    nconroy Member

    Joined:
    Sep 12, 2002
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Wait for response

    You have to make a while loop which waits until the page has returned all the data.

    The new cpanelmail script works like this it took me a while to figure it out.

    Best Regards,
    Nic Conroy
    http://lucidstorm.com
     
Loading...

Share This Page