cPanel, WHM, Webmail login script
By: Daniel
The following code will allow you to login to several different ports that are used for cPanel.
<form action="cpanelLogin.php" method="POST"> // Show an error if the login failed if(($_GET['failed'] == "1") or ($error == 1)){ echo '<font color="#FF0000">Your login attempt failed!</font><br />'; } Domain: <input type="text" name="domain" value="" size="20" /><br /> Username: <input type="text" name="username" value="" size="20" /><br /> Password: <input type="password" name="pass" value="" size="20" /><br /> // This failurl allows cPanel to redirect back to this site echo '<input type="hidden" name="failurl" value="http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?failed=1">'; Options: <select name="port"> <option value="2082">cPanel </option> <option value="2083">Secure cPanel </option> <option value="2086">WHM</option> <option value="2087">Secure WHM</option> <option value="2095">Webmail</option> <option value="2096">Secure Webmail</option> </select><br /> <input type="submit" value="Login" /> </form>
Above we created a very basic form to allow the users to login with. You can spice this up to match your site, you just have to make sure that the field names – the name=” some text ” – remains the same.
If you only want to allow cPanel logins you can change the <select name=”port”> to <input type=”hidden” name=”port” value=”2082″>. This allows you to only show the domain, username and password fields.
One thing you will have to make sure you change is the action on the <form> so that it points to the file you will be saving on the next page of this article.
On the next page is the processing of the code.
Pages: 1 2




















(21 votes, average: 4.62 out of 5)
December 9th, 2006 at 6:50 am
i want cPanel, WHM, Webmail login account.
December 21st, 2006 at 7:57 am
Hi, thanks so much for sharing this out. I’ve looked for this for quite a lot of time but I am glad to have found a solution here. Please keep it up. However, I would like to know if there is a way I could skip the cPanel Management so that I go directly to Squirrelmail. On my host, I only have one email application squirelmail but still I have to go through cPanel Management
January 23rd, 2007 at 12:41 pm
Cant understand what changes i have to do in “the brains of this script” and where to put it?
January 23rd, 2007 at 8:18 pm
Very useful thank you!
February 28th, 2007 at 9:54 am
Excelent!
March 18th, 2007 at 12:29 am
Okay thanks for this.
^_^
April 3rd, 2007 at 9:37 am
Hi I really apreciate this kind of work but it was hard to find it on google I would spread the link of this website so as to appreciate the work
KEEP GOING
October 7th, 2007 at 12:16 am
Thank you for sharing!
January 12th, 2008 at 12:52 am
Thank you, keep it up.
March 20th, 2008 at 2:02 am
plese give me script for cpanelLogin.php
May 1st, 2008 at 2:42 pm
Dash, the cpanelLogin.php is on page 2 of this article: http://www.wlscripting.com/tutorial/33/2/
May 2nd, 2008 at 10:36 am
Thank you for sharing!
dash see : http://www.wlscripting.com/tutorial/33/2/
May 17th, 2008 at 6:16 pm
// This failurl allows cPanel to redirect back to this site
this not work. if all field is complete and the pass or user is wrong then show cpanel login page.
May 28th, 2008 at 4:04 am
I have tried this script but unable to login.
Where to add ip address in this script.
June 26th, 2008 at 1:59 am
Thanks for the most wanted script.
i followed all the instructions, but i got stuck when i input all required information correctly. the error is page can not be displayed.
i saved the cpanelLogin.php file on server in the same directory from where my page refering this to post. but the same error.
Yes my server is php enabled. all other php scripts working which are provided here at your site.(the ones that i checked).
hope to get solution soon as i needed this script.
thanks
September 23rd, 2008 at 10:15 am
If I have customers on more than 1 server, then how would I best integrate the webmail login form? I mean, how does the script know which server to interact with to log the customer into there webmail?
If anyone has experienced this issue, could you please share?
Thanks.
Magik
September 23rd, 2008 at 9:43 pm
This automatically determines which server to login to due to the user putting in their own domain name in the form. Since DNS knows which server that domain name is on it routes the requests to that server.
November 29th, 2008 at 2:42 pm
This cant be secure – it SHOWS the password in the url b4 it logs in. surely thats not good?
December 12th, 2008 at 12:26 pm
I copied and paste the code as it was to the server but the following message appears:
Cannot modify header information – headers already sent by (output started at /home/.obelixdryer/arshaorg/arsha.org/new/globals.php:44) in /home/
I found several articles that states that it’s caused by an extra space but I didn’t find any. Could it be something else or what am I missing?
December 15th, 2008 at 11:50 am
Ivan,
Check that you don’t have any spaces at the end of any lines in the code. This also includes all files that are included in your page.
December 29th, 2008 at 2:19 pm
[...] Update on December 29th, 2008: MartinH on our forums at http://forum.arvixe.com/smf/general/customizing-webmail-interface/ mentioned that while the above script works, there is a notification your visitors will receive using the Opera browser. The following form found at http://www.wlscripting.com/tutorial/33 provides an alternate form that does not give the initial warning in Opera. Also, the form is not using PHP so it can be deployed on servers without the PHP engine (all accounts at Arvixe do have the PHP engine): [...]
January 4th, 2009 at 7:15 pm
Hi
Am trying to get it to work, but like Ivan I am having trouble.
I receive this: Warning: Cannot modify header information – headers already sent by (output started at /home/cklwebco/public_html/cpanelLogin.php:9) in /home/cklwebco/public_html/cpanelLogin.php on line 32.
I have looked for spaces on that line, but after trying everything it still won’t function.
You said to Ivan to find spaces in all files on the page, but are you referring to only the cpanelLogin.php page where teh error is occurring or the page where I am placing the Login?
Cheers for a great script.
Mike
January 5th, 2009 at 10:17 pm
All good Daniel. Please ignore earlier post.
Cheers
Mike
January 16th, 2009 at 5:15 am
Hey Daniel,
I tried to get re-directed to the webmail of cpanel in some what differene manner then this one. This pattern makes the users visit the cpanel. which, then gets auto re-directed ,as I set the Horde as the redirector for them.
I would like to know if there is a way I could skip the cPanel Management so that I go directly to Horde or Squirrelmail.
February 1st, 2009 at 3:14 pm
Thank you so much very usefull
February 17th, 2009 at 6:16 pm
Wao Great Mr. Daniel !
This script realy too much help me.
Good Very Good
Keep continuing post latest script but with little help.
March 25th, 2009 at 11:55 pm
Not working for me
April 18th, 2009 at 3:06 am
not working loginscript please help me sir
June 1st, 2009 at 1:03 pm
i can’t sign in to my email at webmail can you help.
July 21st, 2009 at 5:52 am
Hello,
I can successfully login to my WHM and cPanel but canot login to webmail:2095.
I get a login attempt failed and yes i have double checked my username and password.
August 1st, 2009 at 10:31 am
hello when index.html and upload the php file and attempted to enter the login I get this error
Your login attempt failed!
‘; } ?> Domain:
Username:
Password:
‘; ?> Options:
please check the page
http://www.webhostlm.com/sp/cpanel
January 12th, 2010 at 6:20 am
nice script , i am searching this for all valid ports
January 13th, 2010 at 3:49 am
notworking with me too ..same problem with pagerank tool ..
January 26th, 2010 at 2:57 pm
Hey… very nice script. Works for me. But got just 1 Q. When i login, my password is displayed in the address bar on the next webmail login page. Any suggestion how can i encrypt this password.
January 26th, 2010 at 3:04 pm
When I try secure webmail…It says Certificate Error…..
February 27th, 2010 at 1:15 am
Thx Daniel ,
good job .
This script realy too much help me.
but sir i have one question ?
can we login in webmail without showing the domain name text box and option button . if yes please send me the code on the email id . i will be more thankful
Thanks & Regards
Vasudev
March 10th, 2010 at 8:43 am
its not redirecting to the sam page if login fails ?
May 17th, 2010 at 2:09 am
Thnx Daniel,
Very usefull script. But i m little bit worried about user name and password which is showing in address bar. It can be serious issue if a user is working on a public computer. Any solution will be appreciated.
Thanks & regards,
Shiv
June 20th, 2010 at 9:41 pm
Fantastic web log. Added to Facebook!
June 22nd, 2010 at 7:15 am
Hi Daniel..,
Its a nice article and easy to capture of the concept.. Its a great job to you:-)
Thanks a lot..!
August 19th, 2010 at 8:39 am
If login fails this not redirect to the same page. Have any way to correct this?
March 18th, 2011 at 4:40 am
Your post is very interesting. I’ve read your blog for few days now and I trully enjoy your blog. Thank you for your great work!
March 23rd, 2011 at 12:24 am
thks for the post Daniel. Is it possible to connect with cpanel database from my script i mean if i gave Email id and password for webmail user in my own script then it check is that account exists in the webmail account if is then login otherwise not. if possible plz reply it will be thankful .
June 15th, 2011 at 4:05 am
Ankle Support For Basketball Guru
June 15th, 2011 at 4:11 am
uIflme jrdxalcoccxo, [url=http://owcahiijhtda.com/]owcahiijhtda[/url], [link=http://bvfsejdhmpfz.com/]bvfsejdhmpfz[/link], http://dzuuwxvejaqp.com/
June 15th, 2011 at 4:21 am
A lot of of whatever you assert is supprisingly precise and it makes me wonder why I had not looked at this in this light before. This particular article truly did turn the light on for me personally as far as this specific issue goes. Nevertheless there is actually one position I am not too cozy with and while I try to reconcile that with the core theme of the point, allow me observe what all the rest of your visitors have to point out.Very well done.
June 17th, 2011 at 4:11 am
It’s appropriate time to make a few plans for the future and it is time to be happy. I’ve read this publish and if I may just I wish to recommend you few attention-grabbing issues or suggestions. Maybe you can write subsequent articles referring to this article. I wish to learn more things about it!
June 17th, 2011 at 4:15 am
It’s the pity you actually don’t possess a give money link! I’d surely give money for this superior webpage! We presume at this point i’ll be satisfied book-marking as well as placing your own Feed in order to my personal Search engines accounts. We appear forwards in order to recent changes and can publish this particular web page along with my personal Myspace team: )
June 18th, 2011 at 4:12 am
Very interesting article.
June 20th, 2011 at 10:25 pm
hey there and thank you for your info – I have certainly picked up something new from right here. I did however expertise several technical issues using this site, as I experienced to reload the site many times previous to I could get it to load properly. I had been wondering if your web hosting is OK? Not that I’m complaining, but slow loading instances times will very frequently affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Anyway I’m adding this RSS to my e-mail and can look out for much more of your respective exciting content. Make sure you update this again very soon..
June 21st, 2011 at 4:12 am
It’s any shame you don’t use a give money press button! I’d definitely give money for this unpaid web page! My partner and i think for the moment i’ll be satisfied with bookmarking and also incorporating the Feed to be able to my own Yahoo consideration. My partner and i seem ahead to be able to innovative messages and definately will promote this kind of blog page together with my own Fb team: )
June 21st, 2011 at 4:17 am
Thanks a ton for being the teacher on this issue. I actually enjoyed your current article a lot and most of all enjoyed how you really handled the aspect I widely known as controversial. You’re always extremely kind to readers much like me and let me in my lifestyle. Thank you.
June 23rd, 2011 at 4:06 am
One of my favorite posts.
June 23rd, 2011 at 4:17 am
By the late 1980s, temazepam was a single of the most well-liked and extensively prescribed hypnotics on the market place and it grew to become 1 of the most broadly prescribed medications. Order Restoril tablets.
June 23rd, 2011 at 4:21 am
There are certainly lots of particulars like that to take into consideration. That is a nice point to deliver.
June 23rd, 2011 at 4:22 am
very good post, i certainly love this website, keep on it
June 23rd, 2011 at 4:22 am
Thanks for the great info.
June 26th, 2011 at 4:07 am
Extremely informative post, make money from home is a passion for me and reading other online money makers views and comments on make money online training is very nice.
June 29th, 2011 at 4:15 am
Great blog here i like all the information thats being shared, congratulations.
June 29th, 2011 at 4:22 am
Ambien will make you tumble asleep. Never bring this remedy throughout your regular waking hours, unless you have a complete 7 to 8 several hours to dedicate to sleeping. Cheap Ambien without prescription.
July 2nd, 2011 at 4:12 am
The Zune concentrates on being a Portable Media Player. Not a web browser. Not a game machine. Maybe in the future it’ll do even better in those areas, but for now it’s a fantastic way to organize and listen to your music and videos, and is without peer in that regard. The iPod’s strengths are its web browsing and apps. If those sound more compelling, perhaps it is your best choice.
July 4th, 2011 at 2:47 am
I follow your articles. I ‘ve some Say Thank gonna. Are you the author page, I write?
July 31st, 2011 at 5:23 am
You really make it look so simple together with your presentation but I locate this subject to be truly a thing which I believe I’d by no means understand”
August 5th, 2011 at 4:15 am
Hi awsome blog im from scotland but im moving to manchester i found this on the msn search engine,I like the blog, but could not find how to subscribe to receive the updates by email.
August 6th, 2011 at 8:27 pm
Bookmarked to reread later! A+
August 20th, 2011 at 5:23 pm
I am really loving the theme/design of your website. Do you ever run into any web browser compatibility issues? A handful of my blog visitors have complained about my website not operating correctly in Explorer but looks great in Chrome. Do you have any recommendations to help fix this issue?
August 23rd, 2011 at 5:37 pm
Useful info. I discovered your site by chance. I bookmarked it.
August 24th, 2011 at 12:26 am
Thank you for the sensible critique. Me & my neighbor were just preparing to do some research on this. We got a grab a book from our local library but I think I learned more from this post. I am very glad to see such wonderful information being shared freely out there.
September 6th, 2011 at 10:41 am
Thanks for the great infos.
September 7th, 2011 at 9:52 am
Thanks.I congratulate you for this blog.I’ve really enjoyed. I sincerely thank you again
September 9th, 2011 at 8:29 am
I agree together with your post. However, do you may have any sources I can cite for my paper?
September 9th, 2011 at 3:30 pm
My spouse and i enjoy the precious knowledge everyone offer within your article content. We’re capable of save yuor web blog and feature the children take a look at away listed here frequently. I will be alternatively sure they’ll find out a wide range of different goods right here in comparison with anybody else!
September 10th, 2011 at 1:33 pm
iphone 4 cases
September 12th, 2011 at 2:50 pm
I’m now not positive the place you’re getting your info, however good topic. I must spend some time studying much more or working out more. Thank you for wonderful information I used to be searching for this information for my mission.
September 12th, 2011 at 2:58 pm
Thanks for sharing WLScripting.com » cPanel, WHM, Webmail login script with us keep update bro love your article about WLScripting.com » cPanel, WHM, Webmail login script .
September 15th, 2011 at 9:43 am
I like this things like this homepage and this has given me A few inspiration To succeed, just so Hi and thanks. =)
September 15th, 2011 at 9:58 am
I got what you mean , saved to my bookmarks , very decent website .
September 24th, 2011 at 4:39 am
I love this kind of weblog its a master calmness ! Grateful My spouse and i observed this on yahoo .
October 8th, 2011 at 2:49 pm
Just what I was searching for, thanks for posting.
October 8th, 2011 at 2:50 pm
Just a smiling visitant here to share the love (:, btw outstanding design and style.
October 8th, 2011 at 3:25 pm
Best entry, I hope they still move the issue several times.
October 8th, 2011 at 3:25 pm
I’ll appreciate if you continue this in future.
December 4th, 2011 at 7:18 am
Angry Birds
December 4th, 2011 at 10:05 am
Sites we Like……
[...] Almost every after in a even though we opt for websites that we read. Outlined below are the most popular webpages that we pick [...]……
December 4th, 2011 at 1:07 pm
something to do with Lady gaga!
December 4th, 2011 at 4:39 pm
The heart of your writing whilst sounding reasonable in the beginning, did not work very well with me personally after some time. Someplace within the sentences you actually were able to make me a believer unfortunately just for a while. I however have a problem with your jumps in logic and you would do nicely to fill in all those breaks. When you actually can accomplish that, I would surely be amazed.
December 4th, 2011 at 4:48 pm
We are grateful for the year we worked together and looking forward to effective cooperation next year!
December 4th, 2011 at 6:55 pm
I just like the helpful information you supply on your articles. I’ll bookmark your blog and check again right here frequently. I am reasonably certain I will be told many new stuff proper right here! Good luck for the next!