Results 1 to 25 of 63
-
03-10-2004, 09:44 AM #1Retired Moderator
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 4,721
Form Based cPanel Login (after IE fix)
As you know because of a recent IE patch the old form based cPanel logins directing to a url such as http://user:password@domain.com no longer work for most people.
cPanel have added a built in form to cPanel 9.0 so you just need to send the values "user" and "pass" to that form and away you go.
You can post the values to any of the following:
http://yourdomain.com:2082/login/ (cPanel)
https://yourdomain.com:2083/login/ (secure cPanel)
http://yourdomain.com:2095/login/ (webmail)
https://yourdomain.com:2096/login/ (secure webmail)
Here's a little script you're welcome to use if you like, that gives people the choice of all four logins.
1. save this as cplogin.php (edit the line with your domain or ip)
PHP Code:<html>
<?php
#your domain or ip
$domain = "yourdomain.com";
if(!$_POST['login']) {
exit;
}
$user = $_POST['user'];
$pass = $_POST['pass'];
$port = $_POST['port'];
$port == "2083" || $port == "2096" ? $pre = "https://" : $pre = "http://";
?>
<body onLoad="setTimeout('document.forms[0].submit();',10)">
<form action="<?php echo "".$pre."".$domain.":".$port."/login/"; ?>" method="post">
<input type="hidden" name="user" value="<?php echo $user; ?>">
<input type="hidden" name="pass" value="<?php echo $pass; ?>">
</form>
</body>
</html>
Code:<form action="cplogin.php" method="post"> <table cellspacing="4" cellpadding="0"> <tr><td>Username:</td><td><input type="text" name="user"></td></tr> <tr><td>Password:</td><td><input type="password" name="pass"></td></tr> <tr><td>Login To:</td> <td align="right"> <select name="port"> <option value="2082">cPanel</option> <option value="2083">Secure cPanel</option> <option value="2095">Webmail</option> <option value="2096">Secure Webmail</option> </select> </td></tr> <tr><td align="right" colspan="2"> <input type="submit" name="login" value="login" style="cursor:pointer"> </td> </tr> </table> </form>
-
03-10-2004, 12:20 PM #2Web Hosting Master
- Join Date
- Dec 2002
- Location
- The Shadows
- Posts
- 2,925
login.php also works on most CPanel installations.
Give me a couple hours to get home, and I will approve this.
-
03-11-2004, 06:16 AM #3Junior Guru Wannabe
- Join Date
- Oct 2003
- Posts
- 75
hi,does this script work in cpanel 8 ? (the one you posted) I can't get it to work
-
03-11-2004, 08:03 AM #4Retired Moderator
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 4,721
Re: Form Based cPanel Login (after IE fix)
Originally posted by Loon
remember you need to be running cPanel 9.0 or above.Hyperconfused (™)
-
03-12-2004, 03:03 AM #5Web Hosting Master
- Join Date
- Jan 2001
- Location
- Illinois, USA
- Posts
- 7,175
Thanks
-
03-12-2004, 09:00 AM #6Retired Moderator
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 4,721
A little update that somebody requested.
If you add this line in cplogin.php below the line that starts $post == "2083" then people can login to webmail accounts without having to put the full domain name:
e.g: somebody with john@somereallylongdomain.com can just put the username as "john" or use "john@somereallylongdomain.com" either will work, currently you need to use name@domain.com
PHP Code:$port == "2095" || $port == "2096" && !eregi("@", $user) ? $user = "".$user."@".$domain."" : $user = $user;
-
03-13-2004, 03:39 AM #7Junior Guru Wannabe
- Join Date
- Mar 2004
- Location
- TN, USA
- Posts
- 38
Hi Loon, I tried to install your script and it didn't work. I am using cPanel - 9.1.0-RELEASE 52. It takes me to a page "Access Denied" with a form for login where I can type my user name and password. But typing username and password in the 'Access denied" form is not a good way to go. I am hoping to get some lead from you...
Thank you in advance
-
03-13-2004, 06:31 AM #8Retired Moderator
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 4,721
There's no reason it shouldn't work, it'll take you to an access denied page if you have the username or pass wrong, just the same as it would logging in the regular way.
If you're trying to log into webmail you need to use username@domain.com as the username unless you made the edit and added the extra line i posted.
Other than that just double check you have the domain right in cplogin.php and make sure there's no http:// or www at the beginging.Hyperconfused (™)
-
03-13-2004, 05:32 PM #9Junior Guru Wannabe
- Join Date
- Mar 2004
- Location
- TN, USA
- Posts
- 38
Hi Loon, thank you for your reply. I can create a new account with IP address and you can find it by yourself. I tried many different ways but nothing seems to work. Please email me at: infoquest@bellsouth.net. I will send you the new accounts details in reply of your email.
-
04-13-2004, 08:21 AM #10New Member
- Join Date
- Mar 2004
- Location
- Ireland
- Posts
- 3
Are you sure you changed the domain variable??
Someone requested this change over at the cpanel forums.
One small question, how can we change it so that customers have to enter their domain name? Many of our customers have their own IP.
EDIT : I'm not allowed to post urls so to show you the code I've attached a text file.
-
07-02-2004, 11:21 AM #11Newbie
- Join Date
- Jun 2004
- Posts
- 11
Hey, I love this script, but when i use it on my site, its takes a second for the wrong password screen to pop up but takes like 3 minutes to load when they use the right passwords, im using cpanel 9.4.1 does anyone knw what to do?
-
07-08-2004, 07:06 AM #12New Member
- Join Date
- Jul 2004
- Posts
- 1
hi i did this its works great but itts there a way, that you can hide the domaininsede the code?
I mean to eliminate the form of the domain and have it automaticall inside the code..
thx
-
07-24-2004, 12:26 AM #13Disabled
- Join Date
- Jul 2004
- Posts
- 3
ok,thanks
-
07-28-2004, 04:19 PM #14Junior Guru Wannabe
- Join Date
- Mar 2003
- Location
- New York
- Posts
- 55
Very nice easy to use code, thanks for sharing!
Contact:
E-Mail: Matt@Harbus.Net
-
08-04-2004, 03:49 AM #15Retired Moderator
- Join Date
- Jul 2002
- Location
- Kuwait
- Posts
- 10,620
change this line if u want to add WHM for cplogin.php
from
PHP Code:$port == "2083" || $port == "2096" ? $pre = "https://" : $pre = "http://";
PHP Code:$port == "2083" || $port == "2096" || $port == "2087" ? $pre = "https://" : $pre = "http://";
in the html file add those options
Code:<option value="2086">WHM</option> <option value="2087">Secure WHM /option>
Bashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar
Twitter: Bashar Al-Abdulhadi
-
08-22-2004, 07:03 AM #16Riiiiiiiiiiiiight...
- Join Date
- Apr 2002
- Location
- Hollywood, CA
- Posts
- 3,052
Has anyone been able to get some thing like :
<input type="image" src="/images/submit.png"
I know the plain submit button works fine because i testedit, but i want to use an image for a submit button and it isnt working at all? Any suggestions ?
-
08-22-2004, 08:07 AM #17Retired Moderator
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 4,721
make sure you specify the name for the input as "login" otherwise the script will just exit.
Code:<input type="image" name="login" src="./img.gif" alt="Login" />
Hyperconfused (™)
-
10-05-2004, 08:33 AM #18Always Learning...
- Join Date
- Aug 2002
- Location
- Bharat
- Posts
- 4,808
Originally posted by Loon
make sure you specify the name for the input as "login" otherwise the script will just exit.
Code:<input type="image" name="login" src="./img.gif" alt="Login" />
Code:<input type="image" name="login" src="./img.gif" alt="Login" />
Code:<input type="submit".....
So any one out there found something on it?Vinsar.Net - Quality Web Hosting at Economical Price on USA & European Servers
Offering domains, shared, reseller & VPS hosting.
Reliable Domain Reseller Account Resell Domains with Confidence
-
10-05-2004, 09:31 AM #19Junior Guru Wannabe
- Join Date
- Mar 2004
- Location
- TN, USA
- Posts
- 38
Just after closing the form tag (</FORM>), try the following code:
<A href="javascript:document.cpanel.submit()"><IMG src="./img.gif" width="120" height="33" border="0" alt="Login"></A>
[Note: In the above example 'cpanel' is the form name -- <FORM name="cpanel"...>]
-
11-06-2004, 03:26 AM #20Newbie
- Join Date
- Sep 2004
- Posts
- 21
Dear Loon
I am Peter. I have seen your post and have also enable the CPanel Login as well as Webmail Login by using the code which you posted. Its very nice and working fine with my domain. Here I want to tell you that I have my own Cpanel server and was founding the same code fot my Cpanel and Webmail requirements and I am very much pleased to got it.
Now I need your help again to enable SMS service on my domain. So please help me out in this metter also and send me simple PHP code for SMS as like earlier that you have sent for Cpanel and Webmail Login Page. Pleae help me as I am so much confused and looking for your kind favor. I will be very thanful to you.
Again requesting for your help.
Regards
PeterLast edited by PeterS; 11-06-2004 at 03:29 AM.
-
11-19-2004, 11:48 PM #21Junior Guru Wannabe
- Join Date
- Feb 2004
- Location
- Wisconsin
- Posts
- 92
I wonder if I'm missing something because I got the form to show up fine but when I click on the login button all that happens is I get the cplogin.php as PHP code showing up on my screen as text. What did I miss?
-
11-20-2004, 02:47 AM #22Retired Moderator
- Join Date
- Jul 2002
- Location
- Kuwait
- Posts
- 10,620
seems php isn't enabled?
Bashar Al-Abdulhadi - KuwaitNET Internet Services Serving customers since 1997
Kuwait's First Webhosting and Domain Registration provider - an ICANN Accredited Registrar
Twitter: Bashar Al-Abdulhadi
-
11-20-2004, 11:40 AM #23Junior Guru Wannabe
- Join Date
- Feb 2004
- Location
- Wisconsin
- Posts
- 92
Nope, I figured out the problem... I saved the file wrong. Fixed it.
-
10-20-2005, 06:32 PM #24Web Hosting Master
- Join Date
- Aug 2004
- Location
- Earth
- Posts
- 8,154
Thank you for sharing this, I know it's a bit old thread but still useful!
-
11-06-2005, 06:14 PM #25New Member
- Join Date
- Aug 2005
- Posts
- 2
the code works great in firefox but I allways get login failed in IE
Any clue/solution?