Web Hosting Talk







View Full Version : Creating a logon page...


Eric Trudeau
02-15-2003, 06:33 PM
I am in the process of making a new logon page and need a bit of help. The ultimate goal of this project was to replace the default popup box built into IE and make it look better using a webpage with graphics. All of the code is written and everything looks and works fine. Only one thing left... when a user enters a wrong username or password, the old style logon box comes up. I would like it to go to a variation of my logon page that would have you re-enter the info.

Is there anything I can do to fix this?

Thanks
Eric Trudeau
TierV Solutions

Sheps
02-15-2003, 07:34 PM
What is this for, CPanel, Plesk, HSphere, or password protected directories?

Eric Trudeau
02-15-2003, 10:00 PM
Sorry, this is for cPanel. Host is xAvia (if that matters).

RealityHost
02-15-2003, 10:06 PM
i would be intrested in this aswell however Eric you have got further than me i have the UserName and Password Boxes but i need to know how to interagate that with cPanal

Aushosts
02-15-2003, 10:38 PM
You could write a php script that uses the username and password, and sends it to cpanel, if its sends a OK http message back then use a location header to redirect the user to username:password@cpanelserver.com:2082, then if cpanel sends the password box http code which is access restricted or something its redirects to an error page because the password is wrong...

RealityHost
02-15-2003, 10:56 PM
have you done it before?

Aushosts
02-15-2003, 10:59 PM
Havn't needed too, most customers are happy to use /cpanel/ on there domain, its just easier for them.

gdag17
02-17-2003, 07:06 PM
Hi, Can someone please send me a script or something that does this, i have been trying for a long time to get this done. My e-mail address is admin@elitepctech.com, it would be greatly appreciated. Thanks!

r3leased
02-17-2003, 07:27 PM
Originally posted by gdag17
Hi, Can someone please send me a script or something that does this, i have been trying for a long time to get this done. My e-mail address is admin@elitepctech.com, it would be greatly appreciated. Thanks!

If this isn't a bother i would aswell would like the script, my email is elicit9@earthlink.net

beachtrader
02-17-2003, 07:37 PM
Okay here's a script I pulled from another site. It's not mine and I am taking no credit for it, nor have I tried it yet. But I heard it works great.



<body>
<form name=login method="post" action="submit.php">
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2><b>Client Login</b></h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=user size=15 maxlength="26">
@
<input type="text" value="yourdomain.com" name="domain" maxlength="65" size="15">

</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type="password" name="pass" size="20">
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="submit" value="Login!" name="button">
</td>
</tr>
</table>
</form>
</body>



This calls on "submit.php" for which the following code is presented:


<?
#$domain = "domain.com";
?>
<head>
<title>Logging In...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="1;URL=http://<? print "$user:$pass@$domain"; ?>:2082">
</head>
<body>
<p><b>Hi <? echo $user ?>!</b></p>
<p><b>Please wait while you are logged in!</b></p>
</body>



This part would be to login into one server only with a known IP address:


<?
#$IP = "123.123.123.123";
?>
<head>
<title>Logging In...</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh" content="1;URL=http://<? print "$user:$pass@$IP"; ?>:2082">
</head>
<body>
<p><b>Hi <? echo $user ?>!</b></p>
<p><b>Please wait while you are logged in!</b></p>
</body>




Happy scripting....:D

sHosts
02-17-2003, 09:36 PM
sweet! thanks Richard=)

case
02-18-2003, 01:22 PM
thank you very much beachtrader , this is exactly what i have been looking for .

XN CEO
02-18-2003, 02:20 PM
Hey guys,

http://www.xaviasupport.com/showthread.php?s=&threadid=190 look at the last post by obviousl ... i think that might also help out :)

Eric Trudeau
02-19-2003, 02:41 AM
Hey thanks for the info. I have gotten a little past that... http://login.tierv.com .

My question still is... if a user enters an invalid password I would like it to go back to the logon page instead of poping up the default logon box.

Any ideas?

Thanks
Eric Trudeau
TierV Solutions

ANMMark
02-21-2003, 07:43 AM
There is also a simple JavaScript that will do the trick very quickly. However, I'm not usre if there is a way to make any of these go back to to the login page, upon error, without the implementation of sessions.

cirax
02-21-2003, 12:44 PM
You could always do this scripting some other way. For those that are familiar with scripting and well wouldn't care to update a flat file every so often with client user/pass then you could do this..

use a file like: clientelle.dat (chmod to 666)

in the flat file (clientell.dat) , use the following 'syntax' to display the clients information

$client|$password
$client|$password etc..

in the submit script, use an explode function (exactly like an array function) and have it read off the strings from the flat file

if the information submitted matches any data in the flat file, proceed to: user:pass@domain.com:2082

otherwise make it reset all the information and have the user have to resubmit the data.

hope this helps :D