Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


Help please with login script



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> Webhosting Services Forum
View previous topic :: View next topic  
Author Message
boy143878



Joined: 31 Mar 2008
Posts: 3

PostPosted: Mon Mar 31, 2008 11:03 am    Post subject: Help please with login script Reply with quote

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>
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3640
Location: Sweden

PostPosted: Mon Mar 31, 2008 9:57 pm    Post subject: Re: Help please with login script Reply with quote

Hi and welcome to DEVPPL.

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

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

Or just:
echo "\">";
Back to top
View user's profile Send private message Visit poster's website
boy143878



Joined: 31 Mar 2008
Posts: 3

PostPosted: Thu Apr 03, 2008 7:04 am    Post subject: Re: Help please with login script Reply with quote

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. Smile
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3640
Location: Sweden

PostPosted: Thu Apr 03, 2008 8:58 am    Post subject: Re: Help please with login script Reply with quote

Well, the problem does not lie in the code you posted here then.
Back to top
View user's profile Send private message Visit poster's website
boy143878



Joined: 31 Mar 2008
Posts: 3

PostPosted: Thu Apr 03, 2008 10:01 am    Post subject: Re: Help please with login script Reply with quote

Yes, the code doesn't have a problem, it is a confirmed bug.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> Webhosting Services Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap