View Full Version : email login form
ogrady 04-12-2003, 01:16 PM Hello,
I would like to put a login form for any customer's email address - I, through the help of this forum, was able to install a from that allows customer to login to cpanel.
I need something to point to this (I assume) :
http://usernaem:@64.5.22.62:2095/username+domainname.com
Any help or direction would be appreciated.
Jim/
Please explain more in details, waht do you mean "I would like to put a login form for any customer's email address".
null
ogrady 04-12-2003, 07:29 PM For the form to login into cpanel the client puts in their username and password - for this form i would like the client to login to ANY email account within their own domain - not just their main account.
As an example - here are two email accountw in the same domain - the link from cpanel:
http://inquiry:@www.collegestreet.com:2095/inquiry+collegestreetservices.com/
http://support:@www.collegestreet.com:2095/support+collegestreetservices.com/
Thanks,
Jim
I just wrote a script, i didn't test, you may want to change smth there
<?php
$domain = "www.collegestreet.com";
if(empty($_POST))
die();
if(!$_POST["login"]||!$_POST["pass"]||!$_POST["email"])
die();
$email = str_replace("@", "+", $_POST["email"]);
header("Location: http://".$_POST["login"].":".$_POST["pass"]."@".$domain.":2095/".$email."");
die();
?>
<html>
<body>
<form method="post" action="<?=$_SERVER["PHP_SELF"]?>">
<p> Login:
<input name="login" type="text" id="login">
</p>
<p>Pass:
<input name="email" type="text" id="pass">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
lol, seems like i just found a bug in VBulletin :)
header("Location: http://".$_POST["login"].":".$_POST["pass"]."@".$domain.":2095/".$email."");
die();
ogrady 04-12-2003, 08:21 PM Thanks - let me give it a go and I will let you know -
You were very helpful, i appreciate it,
Jim
ogrady 04-12-2003, 08:43 PM I am not real proficient in php - but i get the following error:
Parse error: parse error in /home/college/public_html/test.php on line 35
I set it up thus:
<html>
<body>
<?php
$domain = "www.collegestreet.com";
if(empty($_POST))
die();
if(!$_POST["login"]||!$_POST["pass"]||!$_POST["email"])
die();
$email = str_replace("@", "+", $_POST["email"]);
header("Location: <a href="http://" target="_blank">http://</a>".$_POST["login"].":".$_POST["pass"]."@".$domain.":2095/".$email."");
die();
?>
<form method="post" action="<?=$_SERVER["PHP_SELF"]?>">
<p> Login:
<input name="login" type="text" id="login">
</p>
<p>Pass:
<input name="email" type="text" id="pass">
</p>
<p>Email:
<input type="text" name="email">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
Thanks again,
Jim
PositiveHost 04-12-2003, 11:39 PM Do you use cPanel?
You need this for NeoMail or Horde login?
ogrady 04-13-2003, 12:21 AM Yes, I use cpanel - I would use this with either NeoMail or Horde - which ever one I could get to work,
Thanks,
Jim
PositiveHost 04-13-2003, 12:34 AM Ok I believe I have a script for NeoMail.
Give me a few minutes.
PositiveHost 04-13-2003, 12:38 AM #put this bit between the head tags
<script language="javascript">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && password && server) {
var neomail = "http://" + username + ":" + password + "@" + server + ":2095/" + username + "+" + server + "/neomail.pl";
window.location = neomail;
}
else {
alert("Please enter your username and password.\nYour username is the bit before the @ sign in your e-mail address.");
}
}
// End -->
</script>
-----------------------------------------------------------------
#this is what you need to put in the body of the page.
<form name=login>
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2><b>Logon to webmail! </b></h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=username size=15 maxlength="26">
@
<input type="text" name="server" maxlength="65" size="15">
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type=password name=password size=20>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</td>
</tr>
</table>
</form>
ogrady 04-13-2003, 01:26 AM Worked perfect!
Thank you for your time - i appreciated it.
Jim
PositiveHost 04-13-2003, 01:33 AM I am glad it worked.
(I didn't write the script though)
~Jon
i moddifyed the script a little and it worn work could any one tell me what could be the problem
thx
<head>
<script language="javascript">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
if (username && password) {
var neomail = "http://" + username + ":" + password + "@vadimegorov.com:2095" + username + "+"vadimegorov.com";
window.location = neomail;
}
else {
alert("Please enter your username and password.\nYour username is the bit before the @ sign in your e-mail address.");
}
}
// End -->
</script>
</head>
<body>
<form name=login>
<table border=1 cellpadding=3>
<tr>
<td colspan=2 align=center>
<h2><b>Logon to webmail! </b></h2>
</td>
</tr>
<tr>
<td>Username:</td>
<td>
<input type=text name=username size=15 maxlength="26">
@VadimEgorov.com
</td>
</tr>
<tr>
<td>Password:</td>
<td>
<input type=password name=password size=20>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</td>
</tr>
</table>
</form>
</body>
|