stuffradio Posted April 11, 2009 Share Posted April 11, 2009 Can anyone help me find out how to check if a twitter username/password is correct upon form submit. I have code to do that in PHP already, but if the user/pass combo is incorrect I want the form to stay where it is so the user can correct the info instead of reloading the page. This is the code function followUser() { $apiUrl='http://twitter.com/friendships/create/'.$this->follower.'.xml'; $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, "$apiUrl"); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_USERPWD, $this->username.':'.$this->password); //Attempt to send $buffer = curl_exec($curl_handle); $resultArray = curl_getinfo($buffer); if ($resultArray['http_code'] == 200): return true; else: return false; endif; curl_close($curl_handle); } Any help with this would be appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/153590-ajax-and-twitter/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.