开发者

PHP - Checking Twitter username and password

开发者 https://www.devze.com 2022-12-25 12:46 出处:网络
Hey, I\'ve been playing around with the Twitter api and I would need one more thing, that no tutorial covers ..

Hey, I've been playing around with the Twitter api and I would need one more thing, that no tutorial covers ..

Here si the code that I use to pick up data:

$curlhandle = curl_init();  
curl_setopt($curlhandle, CURLOPT_URL, "http://twitter.com/statuses/user_timeline.xml");  
curl_setopt($curlhandle, CURLOPT_USERPWD, $username.':'.$password);  
curl_setopt($curlhandle, CURLOPT_RETURNTRANSFER, 1);  
$response = curl_exec($curlhandle);  
curl_close($curlhandle);  
$xmlobj = new SimpleXMLElement($response);

Now can I use that somehow to check, if the $username and $password are valid?

To more explain what I need it for .. I'll have a form, where the 开发者_如何转开发user can type in his login and I need to be able to tell him, if the inserted data is in/valid login.


I wouldn't have thought that this would be possible.

The Twitter terms and conditions make users responsible for their credentials. Giving them to a third party (i.e. you) is pretty irresponsible.

This is why Twitter implements OAuth.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号