Page 1 of 1
one login form, many mail servers
Posted: Mon Dec 05, 2005 9:06 am
by shortcut
Hi.
I'm new to the PHP world and wonder if it is possible to create a login page where users can log in to different mail servers by choosing it in drop down list. The form will have a username field, a password field and a set of 4 mail servers in a drop down list.So, if I introduce sacur, ***** and pick yahoo in the list, I'm supposed to be legged in to my yahoo account.
Does anybody has an idea of how to do it if it is possible at all.
Thanks in advance
sacur
Posted: Mon Dec 05, 2005 9:31 am
by foobar
You'll need to figure out how the form on the mail provider's login page works. Check the source-code to see where the form gets posted to, and what the fields (usually ID and password) are called. Then, have a page with a drop-down with the webmail sites of your choice. When the user selects an option and clicks the submit button, that form gets submitted to a php page which generates an appropriate form and auto-submits it to the webmail login page.
Posted: Mon Dec 05, 2005 9:38 am
by josh
http://www.php.net/curl will help you submit form data (unless you're just fowarding them to their account at yahoo), but I assume they will read their email from your site?
It might just be easier to write a pop3 client in that case.
Posted: Thu Dec 08, 2005 1:41 am
by shortcut
Thanks everybody.
I already had seen the source code of the target pages. I sent the form information to a php script that generates the appropriate form and autosubmits it.It worked, but I found another way out using javascript function that is called onSubmit. The function determines the action and the names of the login and password fields after reading the selected server in a drop down menu.It also worked.
Cool
Posted: Thu Dec 08, 2005 1:46 am
by shiznatix
well what happens if the user disables javascript? gotta think about them! just on the page that it submits to run a switch statment
Code: Select all
switch ($_POST['mail_server'])
{
case "Google":
//use curl or whatever to login to google
break;
case "Yahoo":
//use curl or whatever to login to yahoo
break;
}