It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index For Webmasters Webhosting Services Forum

Help please with login script

Discuss everything about webhotels.

Help please with login script

Postby boy143878 on Mon Mar 31, 2008 10:03 am

Hello all,

I have tried posting this questions in many forums with no response yet. I hope I get lucky here. I pulled this script to create a custom webmail login page. The script works when using a valid user/password. However, if the user/password is incorrect I get sent to the cpanel default webmail login page. I would like to be redirected back to the custom webmail login page if the user/password are incorrect.

Thanks in advance.
Lance


<?php
#Webmail
$protocol = 'http';
$port = 2095;
?>

<html>
<b>cPanel Login</b><br>
<?php
if ($_GET['failed'] == "1") {
echo "Your login attempt failed!";
}
echo "<form action=\"" . $protocol . "://";
echo $_SERVER['HTTP_HOST'] . ":" . $port . "/login/\" ";
echo "method=POST>";
?>
User: <input type=text name=user><br>
Pass: <input type=password name=pass><br>
<?php
echo "<input type=hidden name=failurl value=\"http://" ;
echo $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
echo "?failed=1\">";
?>
<input type=submit value=Login>
</form>
</html>
boy143878
 
Posts: 3
Joined: Mon Mar 31, 2008 9:53 am

Postby webmaster on Mon Mar 31, 2008 8:57 pm

Hi and welcome to DEVPPL.

Try changing:
echo "?failed=1\">";

To:
echo "?failed=0\">";

Or just:
echo "\">";
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby boy143878 on Thu Apr 03, 2008 6:04 am

I'm sorry, that did not work. I've been doing some research and it seems to be a cPanel bug. Unless anyone has a fix for it right now.

Someone at another post advised me to use Curl to post and parse the results. Look for differences between a failed and success and modify your redirect accordingly. But I have no idea what that means. :)
boy143878
 
Posts: 3
Joined: Mon Mar 31, 2008 9:53 am

Postby webmaster on Thu Apr 03, 2008 7:58 am

Well, the problem does not lie in the code you posted here then.
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby boy143878 on Thu Apr 03, 2008 9:01 am

Yes, the code doesn't have a problem, it is a confirmed bug.
boy143878
 
Posts: 3
Joined: Mon Mar 31, 2008 9:53 am


Who is online

Users browsing this forum: No registered users and 0 guests