Results 1 to 25 of 57
Thread: login script on Cpanel??
-
04-05-2003, 05:45 AM #1Junior Guru Wannabe
- Join Date
- Oct 2002
- Posts
- 62
login script on Cpanel??
My current Cpanel login screen is a pop-up screen
Are there a script that can allow me to put a cpanel login section on my page? so my clients can log into their cpanel account?Great Deal Hosting
-
04-05-2003, 05:56 AM #2Web Hosting Master
- Join Date
- Jan 2003
- Location
- Perth, WA, Australia
- Posts
- 1,276
Save this as the file you want to have the login form on...
PHP Code:<html>
<head>
<title>cPanel Login</title>
</head>
<body>
<form method="post" action="cpanel.php">
Username: <input type="text" name="user"><br>
Password: <input type="password" name="pass"><br>
<input type="submit" name="submit" value="Login!">
</form>
</body>
</html>
PHP Code:<?
// Note: Change "yoursite.com" to your domain
if ($_POST["submit"]) {
if ((!$_POST["user"]) || (!$_POST["pass"])) {
echo("Please complete all fields.");
}
else {
header("Location: http://".$_POST["user"].":".$_POST["pass"]."@www.yoursite.com:2082");
}
}
?>
them to complete it, if they enter both, it will log them into cPanel.
Hope it helps.Last edited by digitok; 04-05-2003 at 06:01 AM.
nu-metal.org :: coming soon
-
04-05-2003, 06:02 AM #3Junior Guru Wannabe
- Join Date
- Oct 2002
- Posts
- 62
thank you digitok
this is really helpfulGreat Deal Hosting
-
04-05-2003, 06:04 AM #4Web Hosting Master
- Join Date
- Jan 2003
- Location
- Perth, WA, Australia
- Posts
- 1,276
No problem Also, I just edited it a minute ago, so you should copy it again. If you want the forms on an existing page, just use from <form> to </form>.
nu-metal.org :: coming soon
-
04-05-2003, 08:49 PM #5Web Hosting Guru
- Join Date
- Jan 2002
- Posts
- 261
Nice bit of code. I hacked your code a bit. The reason? If you have multiple web servers, you need a bit more flexibility, so I added a form field for the customer domain name.
===== cpanellogin.html ==========
<html>
<head>
<title>cPanel Login</title>
</head>
<body>
<form method="post" action="cpanel.php">
Domain Name: www.<input type="text" name="yourdomain" size='20'><br>
Username: <input type="text" name="user" size='10'><br>
Password: <input type="password" name="pass" size='10'><br>
<input type="submit" name="submit" value="Login!">
</form>
</body>
</html>
==================================
===== cpanel.php ============
<?
if ($_POST["submit"]) {
if ((!$_POST["user"]) || (!$_POST["pass"])) {
echo("Please complete all fields.");
}
else {
header("Location: http://".$_POST["user"].":".$_POST["pass"]."@$yourdomain:2082");
}
}
?>
==========================
-
04-05-2003, 09:21 PM #6Web Hosting Master
- Join Date
- Jan 2003
- Location
- Perth, WA, Australia
- Posts
- 1,276
So it's basically the same, except the server bit, yeah, but if you expect them to fill in all them details they might aswell just type in www.domain.com:2082 and login using the popup box themselves
nu-metal.org :: coming soon
-
04-06-2003, 02:52 AM #7Junior Guru Wannabe
- Join Date
- Oct 2002
- Posts
- 62
cool guys,
thanks alot
these have been very helpful for meGreat Deal Hosting
-
04-06-2003, 03:05 AM #8Web Hosting Master
- Join Date
- Jan 2003
- Location
- Perth, WA, Australia
- Posts
- 1,276
No problems If you ever need more help, you know where to come.
nu-metal.org :: coming soon
-
05-13-2003, 06:47 AM #9Junior Guru Wannabe
- Join Date
- Feb 2003
- Posts
- 70
I get a blank cpanel.php page after submitting the form. I have checked the fields and they are correct. The form action is set to post to cpanel.php. Any idea what's wrong?
Last edited by irishblue; 05-13-2003 at 10:28 AM.
-
09-03-2003, 03:04 PM #10Junior Guru Wannabe
- Join Date
- Jun 2003
- Posts
- 83
*delete this*
Last edited by urbanweb; 09-03-2003 at 03:11 PM.
-
09-03-2003, 06:59 PM #11Newbie
- Join Date
- Aug 2003
- Posts
- 17
hello,
I just wanted to say digitok thank you for that code it was really helpfull.
Regards,
Eric
-
09-04-2003, 05:46 PM #12New Member
- Join Date
- Sep 2003
- Posts
- 1
How would you go about using this script for logging into neomail from cpanel. I tried using the script by changing the url and port but that didn't work. Any ideas?
-
09-14-2003, 02:38 AM #13Junior Guru Wannabe
- Join Date
- Feb 2003
- Posts
- 37
Hey digitok,
Your cpanel log-in script looked good, so I tried it, the form comes up, and it looks good, how ever after putting in the username & password, another form comes up asking for the input of username & password, what am I doing wrong?
I would really appreciate some help.
Thanks, George
-
09-14-2003, 08:26 AM #14Build It Better!
- Join Date
- Dec 2002
- Posts
- 5,448
I realize that logging in from the hosting company's main page is a nice feature for clients, I use one myself. However if you have to enter a username and password why would you want to do it through an unencrypted form?
Just use a link that points to https://www.yourdomain.com:2083 and take advantage of a secure log in to CPanel...
-
09-14-2003, 09:47 AM #15Junior Guru Wannabe
- Join Date
- Feb 2003
- Posts
- 37
Like you said Watcher_TVI,
"logging in from the hosting company's main page is a nice feature for clients" that is why I would have liked to have it.
Thanks, George
-
09-14-2003, 01:27 PM #16Web Hosting Master
- Join Date
- Nov 2002
- Location
- CA, USA
- Posts
- 1,903
Originally posted by Global
Hey digitok,
Your cpanel log-in script looked good, so I tried it, the form comes up, and it looks good, how ever after putting in the username & password, another form comes up asking for the input of username & password, what am I doing wrong?
I would really appreciate some help.
Thanks, George
Code:<? // Note: Change "yoursite.com" to your domain if ($_POST["submit"]) { if ((!$_POST["user"]) || (!$_POST["pass"])) { echo("Please complete all fields."); } else { ?> <HTML> <HEAD> <META HTTP-EQUIV="refresh" content="0;URL=http://<?=$_POST["user"]?>:<?=$_POST["pass"]?>@www.yourdomain.com:2082"> </HEAD> </HTML> <? } } ?>
◊ James | sales@vnpixel.com |
◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
◊ http://www.vnpixel.com
-
09-14-2003, 01:31 PM #17Web Hosting Master
- Join Date
- Nov 2002
- Location
- CA, USA
- Posts
- 1,903
btw, it is the cpanel.php file
◊ James | sales@vnpixel.com |
◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
◊ http://www.vnpixel.com
-
09-14-2003, 01:46 PM #18Junior Guru Wannabe
- Join Date
- Feb 2003
- Posts
- 37
Thanks VNPIXEL,
You did it, it's working great.
Thanks again, George
-
09-17-2003, 02:42 AM #19Newbie
- Join Date
- Sep 2003
- Posts
- 6
Hello i changed the submit button in a graphical button, but it doesn't work.. here's the button code:
<input type="image" src="images/26.jpg" name="submit width="59" height="33">
When i click it, it goes to the cpanel.php page but it's blank How do i make it work?
-
09-17-2003, 07:07 AM #20Web Hosting Master
- Join Date
- Jan 2003
- Location
- Perth, WA, Australia
- Posts
- 1,276
If that code you pasted is the exact same code you're using... You're missing a " after name="submit.
nu-metal.org :: coming soon
-
09-17-2003, 02:23 PM #21Newbie
- Join Date
- Jun 2003
- Posts
- 18
thank you for a script i was looking for it too
-
09-18-2003, 02:34 AM #22Web Hosting Master
- Join Date
- Nov 2002
- Location
- CA, USA
- Posts
- 1,903
<input type="image" src="images/26.jpg" name="submit" width="59" height="33">
◊ James | sales@vnpixel.com |
◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
◊ http://www.vnpixel.com
-
09-18-2003, 02:59 AM #23Web Hosting Master
- Join Date
- Jan 2003
- Location
- Perth, WA, Australia
- Posts
- 1,276
Uhh... Thanks for the repeat VNPIXEL? :-/
nu-metal.org :: coming soon
-
09-18-2003, 03:02 AM #24Newbie
- Join Date
- Sep 2003
- Posts
- 6
Originally posted by VNPIXEL
<input type="image" src="images/26.jpg" name="submit" width="59" height="33">
Even when i add the ", it still doesn't work. It stucked at the blank cpanel.php page
-
09-19-2003, 04:26 AM #25Web Hosting Master
- Join Date
- Nov 2002
- Location
- CA, USA
- Posts
- 1,903
I just try to put the color and bold on the part you told him. NOT TRY to take your credit. *sigh*
◊ James | sales@vnpixel.com |
◊ aim: vnpixel • msn: support@vnpixel.com • yahoo: vn_pixel
◊ http://www.vnpixel.com