【发布时间】:2015-02-27 19:04:50
【问题描述】:
我之前在 php 中使用 imap_open 函数从表单验证用户的凭据并让他们登录到我的网站。 现在我还想打印他们的名字,这些名字可以从谷歌服务器中获取,提供他们的凭据作为输入。
我想打印类似“Hello $gmail->firstname to the website”之类的内容, 通过从表单提供相同的用户凭据作为输入到 php 文件。
在不使用 Open ID API 的情况下有没有办法做到这一点?
我的 php 验证函数类似于:-
function validate($username,$password) {
$username = strtolower($username);
$server="{imap.gmail.com:993/imap/ssl}";
$result=false;
$result = imap_open($server,$username,$password);
if($result) {
return 1;
}
else {
return 0;
}
}
【问题讨论】:
标签: php forms gmail-imap imap-open