Adding a cPanel/WHM/WebMail login box to your site.

rvskin

Well-Known Member
PartnerNOC
Feb 19, 2003
400
1
168
Where is the right location for this file?
If I put it in my main website such as http://domain.com/cpanellogin.php and user enter wrong password, it will send to the unbranded X skin page asking username and password again.
 

PWSowner

Well-Known Member
Nov 10, 2001
2,948
4
343
ON, Canada
Done.

I added a cpanel and webmail login to my site. If anyone wants to see how I made both options available, just look about 2/3 of the way down the source code of http://www.premierwebsitesolutions.ca/members.pws.

I made a tiny change so if someone enters wrong info, they don't see "Your login attempt failed!" for both options.

Thanks Nick.
 

PWSowner

Well-Known Member
Nov 10, 2001
2,948
4
343
ON, Canada
Here's the piece of php code for that part of my page.

Code:
<table align="center" border="0" cellpadding="25" cellspacing="0">
<tr><td align="left">
<p align="left">
<font size="+1" color="#0000a0">cPanel Login</font></p>
<?php
if ($_GET['cfailed'] == "1") {
?>
<p align="left">
<font color=#ff0000><b>Your login attempt failed!</b></font></p>
<?php
}
print "<form action=\"https://" . $_SERVER['HTTP_HOST'] . ":2083/login/\" method=\"post\">";
?>
<p align="left">
<b>Username: </b><input type="text" name="user" size="10"><br>
<b>Password: </b><input type="password" name="pass" size="12"><br>
<?php
print "<input type=\"hidden\" name=\"failurl\" value=\"http://" .  $_SERVER['HTTP_HOST'] .
 $_SERVER['PHP_SELF'] . "?cfailed=1\">";
?>
<input type="submit" value=" Login ">
</form></p>
</td><td align="left">
<p align="left">
<font size="+1" color="#0000a0">Webmail Login</font></p>
<?php
if ($_GET['mfailed'] == "1") {
?>
<p align="left">
<font color=#ff0000><b>Your login attempt failed!</b></font></p>
<?php
}
print "<form action=\"https://" . $_SERVER['HTTP_HOST'] . ":2096/login/\" method=\"post\">";
?>
<p align="left">
<b>Username: </b><input type="text" name="user" size="10"><br>
<b>Password: </b><input type="password" name="pass" size="12"><br>
<?php
print "<input type=\"hidden\" name=\"failurl\" value=\"http://" .  $_SERVER['HTTP_HOST'] .
 $_SERVER['PHP_SELF'] . "?mfailed=1\">";
?>
<input type="submit" value=" Login ">
</form></p>
</td></tr>
</table>
 
Last edited:

rvskin

Well-Known Member
PartnerNOC
Feb 19, 2003
400
1
168

rvskin

Well-Known Member
PartnerNOC
Feb 19, 2003
400
1
168
I agree. This is definitly what I want. Many times I have to answer who is CpanelX. Users thought I was a reseller for them.

Nick, could you tweak it a bit allowing a hidden field
<input type="hidden" page="3rdparty/squirrelmail/index.php">

I want users login to SquirrelMail immediatly. No more webmail application selector.
 

rvskin

Well-Known Member
PartnerNOC
Feb 19, 2003
400
1
168

Nibuha

Member
Feb 3, 2004
19
0
151
fluidhosts said:
We Wrote our own just trying to figure a way to make it does multi servers.

Http://www.FluidHosts.com
Use a drop down ... you would have to name your servers for clients or something.

Bob, kim ... stuff like that ... so you tel them what server they are on and so when they pick it just points at the right IP and then adds the :2086 or so on.

I use that for all the different logins