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.

Sign Up form for Webmail

Discussion in 'cPanel Developers' started by bigtreeworld, Apr 11, 2011.

  1. bigtreeworld

    bigtreeworld Registered

    Joined:
    Apr 11, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hey everyone,

    What I need is some system (preferrably a form) by which users can create a Webmail account which they can use to login to mysite.com:2096. I want it so that they can't look at the source code and see my cPanel credentials, and it would be nice if there was a anti-robot system involved.

    Thanks a lot in advance :)
     
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Friendly moderator note

    I moved this thread to our Developer Discussions section.
     
  3. bigtreeworld

    bigtreeworld Registered

    Joined:
    Apr 11, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks. Anybody have any ideas?
     
  4. rlesterphx

    rlesterphx Member

    Joined:
    Jul 22, 2010
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    How proficient are you with PHP and HTML? The way I would set it up is create a form with the username and password fields, plus a CAPTCHA-type entry to prevent bots. Here's a good free CAPTCHA script:
    Securimage PHP Captcha | Free Captcha Script

    The form should post to a script that uses the cPanel API to create the mail account. This part requires quite a bit of programming knowledge to set up and make the API call and then parse the returned data, but luckily the cPanel guys have done a really good job on their end with the API that takes a lot of the pain out of things like validation and checking to see if there's already an existing account with the entered name. If there are any errors the API will return detailed info, otherwise it will just set up the account and return a success message.

    Once that script finishes it should return the result to the user. This could be done with a header redirect or you could have the whole thing flow smoothly with AJAX so the user never leaves the form page...There are ton of ways you could set it up.

    So in a nutshell:
    User fills out signup form > Values are posted to a script that makes the API call > Script returns the error or success message to the user > Once the account is successfully created the user can log in at your webmail link
     
  5. bigtreeworld

    bigtreeworld Registered

    Joined:
    Apr 11, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Thanks. Now, is there a simple API explanation or something that can introduce me to the cPanel API, especially when it comes to email? (The simpler the better)
     
  6. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    All of our API documentation, including links to basic introductory material, is available here:

    cPanel & WHM's SDK

    Please let us know if you have any specific questions, and we will do our best to help you.
     
  7. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page