On the cpanel faq page, the below file is provided for uploading to the /cpanel3-skel / public_html/ directory. It resolves as the default index page for any domain lacking an index page in their /username/public_html. I tried it and it works up to a point.
Here's the fly in the ointment:
File Type: PHP script text
[Web Hosting Company Name Here]
cPanel Login
Your login attempt failed! "; ?> User:
Pass:
"; ?>
Source
What am I doing wrong?? It's pretty obvious I need to change some text, but the code is showing complete with the text boxes, but it doesn't give you a chance to enter the login.
Here's the script:
<?php
#Login Configuration
#cPanel
$protocol = 'http';
$port = 2082;
#Secure cPanel
#$protocol = 'https';
#$port = 2083;
#WHM
#$protocol = 'http';
#$port = 2086;
#Secure WHM
#$protocol = 'https';
#$port = 2087;
#Webmail
#$protocol = 'http';
#$port = 2095;
#Secure Webmail
#$protocol = 'https';
#$port = 2096;
?>
<html>
<h1>[Web Hosting Company Name Here]</h1>
<b>cPanel Login</b><br>
<?php
if ($_GET['failed'] == "1") {
?>
<font color=#FF0000>Your login attempt failed!</font>
<?php
}
print "<form action=\"" . $protocol . "://" . $_SERVER['HTTP_HOST'] . ":" . $port . "/login/\"
method=POST>";
?>
User: <input type=text name=user><br>
Pass: <input type=password name=pass><br>
<?php
print "<input type=hidden name=failurl value=\"http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
?>
<input type=submit value=Login>
</form><br>
<a href="cpanel-login.phps">Source</a><br>
Note: This examples requires cPanel 9.4.1 or later!
</html>
Here's the fly in the ointment:
File Type: PHP script text
[Web Hosting Company Name Here]
cPanel Login
Your login attempt failed! "; ?> User:
Pass:
"; ?>
Source
What am I doing wrong?? It's pretty obvious I need to change some text, but the code is showing complete with the text boxes, but it doesn't give you a chance to enter the login.
Here's the script:
<?php
#Login Configuration
#cPanel
$protocol = 'http';
$port = 2082;
#Secure cPanel
#$protocol = 'https';
#$port = 2083;
#WHM
#$protocol = 'http';
#$port = 2086;
#Secure WHM
#$protocol = 'https';
#$port = 2087;
#Webmail
#$protocol = 'http';
#$port = 2095;
#Secure Webmail
#$protocol = 'https';
#$port = 2096;
?>
<html>
<h1>[Web Hosting Company Name Here]</h1>
<b>cPanel Login</b><br>
<?php
if ($_GET['failed'] == "1") {
?>
<font color=#FF0000>Your login attempt failed!</font>
<?php
}
print "<form action=\"" . $protocol . "://" . $_SERVER['HTTP_HOST'] . ":" . $port . "/login/\"
method=POST>";
?>
User: <input type=text name=user><br>
Pass: <input type=password name=pass><br>
<?php
print "<input type=hidden name=failurl value=\"http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?failed=1\">";
?>
<input type=submit value=Login>
</form><br>
<a href="cpanel-login.phps">Source</a><br>
Note: This examples requires cPanel 9.4.1 or later!
</html>
Last edited: